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: adding # pragma: no branch in middleware/test_base and test_routing #2807

Merged
merged 2 commits into from
Dec 21, 2024

Conversation

lealre
Copy link
Contributor

@lealre lealre commented Dec 20, 2024

Summary

Related to issue #2452.

Adding # pragma: no branch in to all the cases

tests/test_routing.py 874->exit

As we talked, I searched for the cause of missing branch coverage in the parametrize line 874, and it turns out that the lambda function is what is causing it.

There is this comment, which is somewhat related, but old. In this comment (also old), it is mentioned that it was supposed to inform a custom lambda message in the HTML report, but it differs from the message we are encountering here.

Captura de ecrã 2024-12-20 233703

tests/middleware/test_base.py

I believe that in these cases, there are no branch options to be tested, and I am sending this for your confirmation.

One note: the line 459->457 sometimes appears as missing branch coverage in some test runs, while at other times it appears as already covered.

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 21, 2024 19:10
@Kludex Kludex merged commit f884b66 into encode:master Dec 21, 2024
6 checks passed
@lealre lealre deleted the branch-coverage-in-tests-dir branch December 21, 2024 19:43
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