Skip to content

tests: branches coverage in test_authentication, test_background, test_responses, test_routing#2796

Merged
Kludex merged 4 commits intoKludex:masterfrom
lealre:coverage-in-tests-folder
Dec 15, 2024
Merged

tests: branches coverage in test_authentication, test_background, test_responses, test_routing#2796
Kludex merged 4 commits intoKludex:masterfrom
lealre:coverage-in-tests-folder

Conversation

@lealre
Copy link
Contributor

@lealre lealre commented Dec 14, 2024

Summary

Related to issue #2452

This PR addresses the cases in the test files below and essentially adds #pragma: no branch to all the cases, except for test_authentication, where I changed the #pragma: no cover line to cover the function that is not used.

From what I can see, there are no branch options to be covered, as the code relies on elif conditions or depends on a condition to pass the test.

File Branches
tests/test_authentication.py 213->210
tests/test_background.py 76->exit
tests/test_responses.py 268->exit, 752->exit
tests/test_routing.py 800->802, 874->exit

The only one I don't fully understand is test_routing (line 874), where it's marking the @pytest.parametrized test as having uncovered branches.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@Kludex Kludex enabled auto-merge (squash) December 15, 2024 15:26
@Kludex Kludex disabled auto-merge December 15, 2024 15:26
@Kludex Kludex enabled auto-merge (squash) December 15, 2024 15:27
@Kludex Kludex merged commit 827de43 into Kludex:master Dec 15, 2024
@lealre lealre deleted the coverage-in-tests-folder branch December 15, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments