Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Dec 15, 2024

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.

tests/test_routing.py Outdated Show resolved Hide resolved
@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 encode:master Dec 15, 2024
6 checks passed
@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