-
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
Test discovery fails with ValueError: I/O operation on closed file. #20826
Comments
Hello! Could you try running pytest discovery in the terminal and see the result? |
Hi @eleanorjboyd, thanks for the support.
I ran the command in the terminal (updated the description to be explicit I ran it in PowerShell), the output is reproducible and the same as above. Edit: I did not look closely, now I see this output (I inserted the "... (more tests) ..." portion manually):
|
@eleanorjboyd or did you mean to run it in the VS Code terminal? Happy to support in any other way. |
yes- that would be great. Sorry for the delay! |
Getting the same error as in #20826 (comment) from the VS Code terminal (which is a PowerShell). |
Hi @fleimgruber, if pytest is unable to discover the tests correctly than we cannot parse that output and display it in our UI therefore you should look into getting the pytest error fixed and our discovery will be fix as well. Thanks! |
closing as this is a pytest error not vscode- please reopen if you think that is not the case. |
For reference, this is the related upstream pytest issue: pytest-dev/pytest#5502. What was causing the error for me was test code that imported from a module that imported a lot of dagster - which apparently does some offending (according to pytest authors) stdio handling at import time. I did not dig further into it, just removed the related tests. |
OS: Windows
VS Code: 1.76.0
Python: venv created using Poetry and pyenv-win
Running the relevant test discovery command from CLI (PowerShell 7.2.1):
shows this error:
The text was updated successfully, but these errors were encountered: