-
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
Python test failing ERROR: file not found: ./test_mything_plugin.py::test_get_conn #9349
Comments
Thanks for the bug report! We just wanted to quickly acknowledge we received it and we will triage this as soon as we can. |
@toddljones Can you share the layout of your workspace folder? I want to understand where the test file is with respect to the current working directory. |
I just created a mock project to simplify things and so as to not share my project info. I started with a new WSL session and launched code from there. I built a minimal python venv using conda then added a foo.py and test/test_foo.py file with just your basic guts. I ran the configure tests function. Then when I pressed play on the test I got the file not found error. Also the annotations are missing from the test_foo.py file. Error message in the OUTPUT Python Test Log:
|
I just validated that screen shot got posted well. I believe you can see every line of my project there, both py files, and the settings.json for the workspace. |
Environments I've tried this project in: |
Interestingly, this works fine if I press the Play All button at the top, it's only when I Play an individual test that I get the error. |
#6881 may be related. |
I have the same error running on macOS. I can execute pytest from the command line perfectly fine, but cannot run in vs code. |
Hey Alex, I'm still not 100% clear on why the above was failing. But in another project I have, I was using symlinks and this caused quite a few issues. Once I moved away from all the symlinking, all the VSCode test features started working. |
Thanks @toddljones I'll give it a shot |
I have the same error in here. When I press the button "Run All Tests" it works fine. But when I try to run individual tests I received the error |
Having the exact same issue, works for 'All Tests' but not individually. |
Having something similar to this. In our case turns out that it relates to the fact that we are using symlink as workspace dir. And this vscode-python extension's pytest test discovery hits a pytest issue that it gets wrong info about test file paths when workspace dir is a symlink. See also ticket I created to pytest pytest-dev/pytest#9008 |
Starting with 2021.9 (which will be released this week) we have new system manage test ux. Please try this out with that. |
very similar to issue #8222 on the vscode-python github.com issues list, but that thread seemed dead, so I am opening a new one
Environment Data
VSCode install
VSCode Remote - SSH
I am using VSCode Remote - SSH to do all dev and testing on a remote linux system, version 0.48.0
VSCode Extensions
Using only the VSCode Python extension
ms-python.python
version2019.11.50794
I used to use the python test extension but that capability is now absorbed into the python extension, which is great
VSCode project settings.json
Python
Expected behavior
Actual behavior
Output
Developer Tools Console
Python Output
_when I hit the debug button, I get nothing, but when I hit the Play button, I get this
The text was updated successfully, but these errors were encountered: