Go to file
Liang Laura Moragues Hincapie eb1fb0ef0d
Create README.md
Started template
2024-06-27 22:23:59 +02:00
.github Merge pull request #10315 from webknjaz/maintenance/gha-check 2024-06-18 16:30:54 +02:00
bench [ruff UP031] Fix to use format specifiers instead of percent format 2024-04-30 18:06:26 +02:00
changelog unittest: fix assertion errors on unittest reruns 2024-06-07 10:21:15 +03:00
doc/en [automated] Update plugin list (#12462) 2024-06-16 05:24:06 +00:00
extra [pylint 'consider-using-sys-exit'] Fix all occurences in existing code 2024-05-29 14:36:01 +02:00
scripts [pre-commit.ci] pre-commit autoupdate (#12115) 2024-03-13 15:30:18 +02:00
src Update __init__.py 2024-06-18 21:53:50 +02:00
testing Modernize the skipped `test_issue_9765` regression test (#12468) 2024-06-17 15:44:14 +00:00
.coveragerc coverage: add assert_never to exclude_lines 2021-10-02 14:26:04 +03:00
.git-blame-ignore-revs [ruff] Add change to format in the git blame ignore file 2024-04-30 18:13:04 +02:00
.gitattributes Add codecov support to AppVeyor and remove coveralls 2018-09-05 19:50:06 -03:00
.gitignore Parse args from file (#12085) 2024-03-09 08:51:52 +02:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate (#12470) 2024-06-18 08:29:53 -03:00
.readthedocs.yml Configure ReadTheDocs to fail on warnings (#11535) 2023-10-23 09:56:33 -03:00
AUTHORS Docs: clean up various documentation pages (#12451) 2024-06-13 09:09:02 -03:00
CHANGELOG.rst port the rest of the scripts/docs over to the main branch 2021-03-18 22:13:12 +01:00
CITATION Fix linting issues 2018-07-14 16:35:33 +01:00
CODE_OF_CONDUCT.md remove myself from the list of coc handlers (#6857) 2020-03-03 19:08:59 -03:00
CONTRIBUTING.rst Docs: clean up various documentation pages (#12451) 2024-06-13 09:09:02 -03:00
LICENSE Change copyright notice so yearly updates are not needed 2021-11-30 09:28:23 -03:00
OPENCOLLECTIVE.rst doc: fix typos in OPENCOLLECTIVE.rst [ci skip] 2019-07-10 20:15:22 +02:00
README.md Create README.md 2024-06-27 22:23:59 +02:00
README.rst docs: update plugins number 2024-03-01 05:43:57 +08:00
RELEASING.rst Adjustments to the release process (#11410) 2023-09-08 07:22:16 -03:00
TIDELIFT.rst add myself to tidelift 2024-03-04 12:59:54 +01:00
codecov.yml Adjust codecov: only patch statuses 2020-06-02 08:17:43 -03:00
pyproject.toml [pylint 'implicit-str-concat'] fix existing unwanted implicit str concat 2024-05-29 14:36:01 +02:00
testing.txt Test 1 2024-06-27 16:29:57 +02:00
tox.ini unittest: fix assertion errors on unittest reruns 2024-06-07 10:21:15 +03:00

README.md

Report for Assignment 1

Project chosen

Name: Pytest

URL: https://github.com/pytest-dev/pytest/tree/main

Number of lines of code and the tool used to count it: 77.686 - lizard Screenshot 2024-06-27 at 22 16 31

Programming language: Python

Coverage measurement

Existing tool

We used tox to run the tests and measured their coverage using coverage.py. The specific commands that were used are:

$ tox $ coverage html

This allowed us to run all tests in the repository and summarised the coverage of each test in an html file. Here is a screenshot of the results:

The results indicate that the tests have a branch coverage of 38% on the program.

![Screenshot 2024-06-27 at 22 18 22](https://github.com/apanayotova03/pytest/assets/122705116/74aedda1-54a4-4a50-bd9b-8af833493ef8)

Your own coverage tool

Anastasia create_terminal_writer() ![Screenshot 2024-06-27 at 22 19 26](https://github.com/apanayotova03/pytest/assets/122705116/b4933dba-97e4-4337-acc1-1d77c9afb250) New branch coverage: 100% ![Screenshot 2024-06-27 at 22 20 47](https://github.com/apanayotova03/pytest/assets/122705116/e2c5a548-2373-4c05-9710-31666b811296)

<Function 2 name> def _strtobool()

<Show a patch (diff) or a link to a commit made in your forked repository that shows the instrumented code to gather coverage measurements>

New branch coverage: 100%

Coverage improvement

Individual tests

Anastasia

<Test 1>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test> Screenshot 2024-06-27 at 22 21 40

<Provide a screenshot of the old coverage results (the same as you already showed above)>

Previous branch coverage: 50%

Screenshot 2024-06-27 at 22 22 09

New branch coverage: 100%

The branch coverage has doubled from 50% to 100%. The reason is because the previous tests did not check every case, for example the case when the colour option was either set to “yes” or “no”. However, the new test checks for all four different cases.

<Test 2>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>

<Provide a screenshot of the old coverage results (the same as you already showed above)> Previous branch coverage: 0%

The branch coverage has improved from 0% to 100%. In the original test, neither of the branches were covered, possibly due to the fact that the function was not called. However, the new test checks all 3 different branches, creating a branch coverage of 100%.

Ana Alexandra Cornea

<Function 1 name> fullwidth()

<Show a patch (diff) or a link to a commit made in your forked repository that shows the instrumented code to gather coverage measurements>

<Function 2 name>

<Provide the same kind of information provided for Function 1>

Coverage improvement

Individual tests

Ana Alexandra Cornea

<Test 1>

<Provide a screenshot of the old coverage results (the same as you already showed above)>

<Test 2>

<Provide the same kind of information provided for Test 1>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the instrumented code to gather coverage measurements>

Liang Laura Moragues Hincapie

<Function 1 name> get_terminal_width()

<Show a patch (diff) or a link to a commit made in your forked repository that shows the instrumented code to gather coverage measurements>

<Function 2 name> _highlight

<Provide the same kind of information provided for Function 1>

Coverage improvement

Individual tests

Liang Laura Moragues Hincapie

<Test 1>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>

<Provide a screenshot of the old coverage results (the same as you already showed above)>

New branch coverage is 100%

<Test 2>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>

<Provide a screenshot of the old coverage results (the same as you already showed above)>

Anda Gabriela Barbu

<Function 1 name> should_do_markup()

<Show a patch (diff) or a link to a commit made in your forked repository that shows the instrumented code to gather coverage measurements> The code of the new test after creating a branch array

def test(): # Branch Id 1 os.environ["PY_COLORS"] = "1" test = should_do_markup(None) del os.environ["PY_COLORS"] assert test == True

os.environ["PY_COLORS"] = "0"
test = should_do_markup(None)
del os.environ["PY_COLORS"]
assert test == False


# Branch Id 3
os.environ["NO_COLOR"] = "1"
test = should_do_markup(None)
del os.environ["NO_COLOR"]
assert test == False


# Branch Id 4
os.environ["FORCE_COLOR"] = "1"
test = should_do_markup(None)
del os.environ["FORCE_COLOR"]
assert test == True


# Branch Id 5
test = should_do_markup(None)
assert test == False


os.environ["PY_COLORS"] = "1"

if name == "main": test()

<Function 2 name>

<Provide the same kind of information provided for Function 1>

Coverage improvement

Individual tests

<Test 1>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>

<Provide a screenshot of the old coverage results (the same as you already showed above)>

<Test 2>

<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>

<Provide a screenshot of the old coverage results (the same as you already showed above)>

Overall

<Provide a screenshot of the old coverage results by running an existing tool (the same as you already showed above)>

Statement of individual contributions