-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
Branch coverage false positive for exit context #1770
Comments
This commit doesn't seem to be in the repo anymore, and when I ran nox on trunk, I got:
Is this still happening somewhere I can look at? |
I pushed a tag for the commit. I just double-checked and ran the repro steps in a clean docker image and they do work for me. So maybe pushing that tag helped keep that commit active. |
OK, I got the commit, but I still have 100% coverage: https://gist.github.com/nedbat/3ad003d2c6428282e3249fd33a5f8e2d |
So hard to reproduce the issue reliably :( I see in your run that the Since I supplied the Docker repro instructions, are you able to use those to replicate the missed expectation? Since you're not able to reproduce the issue, that suggests the issue may be sensitive to the environment, and since the issue occurs on my mac and in a Linux docker image I created, it makes me think there may be something about my environment that's triggering the behavior. I'll try paring the Docker image down to its minimal requirements. |
Here's a more minimal docker image that replicates the missed branch: FROM ubuntu:noble
ENV TZ=UTC
RUN apt update
RUN apt install -y software-properties-common
RUN apt-add-repository -y ppa:deadsnakes
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y git python3 pipx
RUN apt install -y python3.9-dev python3.9-venv
RUN git clone https://github.com/jaraco/towncrier
WORKDIR towncrier
RUN git checkout e5c6df77d
RUN pipx install nox
ENV PATH=/root/.local/bin:$PATH
CMD nox |
Describe the bug
In twisted/towncrier#591 (comment), I encountered what appears to be a spurious false positive. The coverage report is indicating that
20->exit
is not covered. even though that line seems to be unequivocally covered (how could that context not exit?).To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
Expected behavior
That line is covered by the code, so there should be no coverage concerns. Moreover, an earlier version of the code does not exhibit the issue (even though it also opens the file in a context).
Am I missing some crucial detail here?
The text was updated successfully, but these errors were encountered: