-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
"Run Test with Coverage" runs *all* tests when test execution fails #24307
Comments
hoping to take a look at fixing this soon- sorry for the delay |
I'm getting something similar actually, might be relevant given closeness in time of reports: I'm trying to run one test but it 'fails to detect the test ID'. Note that I'm using devcontainers, with Python + Pylance + pytest explorer installed inside. Also, not sure if relevant: I looked at /tmp/ but can't see any files named like this. I only see files named like LOGS:
At this point I see this in my test results:
Python logs don't show anything useful after that and I cancel the test runs. I also |
hm interesting- this seems different, could you file a new issue? We use that txt file as a temp to transfer the names of the test ids to the subprocess we spin up so I would guess it might be permissions having to do with the temp directory since we aren't doing anythign specific beyond that |
Done, put it in #24406 |
Hi @bersbersbers, could you clarify what you mean here: "do not run all tests when test execution fails". Which test execution fails? The reading the testIds? Also could you give it another try - we have changed to using a different communication method which might help, this is only out on the pre-release of the python extension so you would need to try it there. Thanks! |
What I mean is that in the code snippet above,
Yes, will do tomorrow. But I am fairly certain the commuication method does not have anything to do with this, because it's not the reading of test IDs that fails, but the test process itself. |
I did. Obviously, since #24308 seems to be fixed, my original reproducer does not work any more. But I can still reproduce the behavior by adding if any("::" in arg for arg in args):
raise RuntimeError("foo") to (This is supposed to simulate a Then run test with coverage for a single test. What then happens is:
(This is with v2024.21.2024111501) |
TLDR:
I am currently debugging a problem in my tests, most likely related to nedbat/coveragepy#1392. I am trying the
omit
workaround, but currently, I am gettingvscode-pytest
errors such as:When this happens, VS Code re-starts all tests, which is not what I want at all.
Compare this snippet:
vscode-python/python_files/vscode_pytest/run_pytest_script.py
Lines 54 to 67 in e8dd8c0
IMHO, this should rather be something like (untested!) - note the
return
in the first block and the differentarg_array
in the last block:The text was updated successfully, but these errors were encountered: