-
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
pytest broken (run fails on module discovery, debug works) #14579
Comments
I'm seeing the same. FYI @schperplata, if it's interrupting your workflow, you can install the previous version: |
This is likely due to the changes in |
Just a clarification, I don't use pip 'editable' mode. My folders with modules are added to %PYTHONPATH% process env var prior VSCode is run |
I had the same problem on Linux version of VSC - it just started today. Problems panel and pytest both reported not finding my module (which I install in pip editable mode). But I could run my tests from the terminal with pytest and the code otherwise ran fine. And the tests would also run in debug mode. I just rolled back to version 2020.9.114305 and it now works fine. I also had this sys path added when running the test but not otherwise: .vscode/extensions/ms-python.python-2020.10.332292344/pythonFiles |
I'm seeing the same issue on Mac - Rolling back to version |
Just want to quickly knowledge that we've received the issue and will be getting back to you soon! |
@schperplata Unfortunately, I am unable to reproduce this issue with a simple folder. My test file looked like this,
Output for
|
Here is a simpe example that reproduce exactly the same outcome: works in Python Test log tab:
Python tab:
The behaviour is the same with Python 3.6 (originally reported).
This is probably the cause? |
Here is a sample app that reproduces the problem for me - https://github.com/mrdavidlaing/vscode-python-issue14579-example. Here is a screenshot showing the errors I see when using
Output from the Output > Python panel is as follows:
And the
If I downgrade to `2020.9.114305` both these errors go away:
I believe the key difference is the omission of the "root" folder -
|
Adding an |
Thanks all for the info! Should be fixed as part of #14570 which is planned for the next release. |
I still have this issue on Ubuntu 20.04 i.e. discovery and debug work, but running all the tests fails because PYTHONPATH is not correctly set. VSC version: 1.56.2 By rolling back to v2020.9.112786 of ms-python.python this works instead. |
@giuliano-97 Please open up a new issue and we can help you there. |
Issue Type: Bug
With the latest Python extension update (
2020.10.332292344
), pytests are unable to run tests, while I can debug them normally. This happens only when pytests are run via VS Code. If run via cmd, this is is not the case.Works on previous version:
v2020.9.114305
.I discovered that new plugin has different
sys.path
list.Debug (working):
While run (failing):
As you can see, first enty:
w:\AsystLib\isys\python
is missing and is replaced with VSC extension path. Error:isys
is a folder inside:w:\AsystLib\isys\python
where many modules are placed, for exampleisys.generic
. Module is accessible in standard run/debug launch configuratoin, but not in pytestrun
mode.I couldn't reproduce this with the most simple single-folder VSC workspace. My workspace merge a couple of folders, some with and some without VSC wks/settings files. There are errors in other workspace folders, but this does not explain this scenario, where
debug
works whilerun
doesn't.Let me know how can I help since this is again, major drawback in workflow.
Extension version: 2020.10.332292344
VS Code version: Code 1.50.1 (d2e414d9e4239a252d1ab117bd7067f125afd80a, 2020-10-13T15:06:15.712Z)
OS version: Windows_NT x64 10.0.18363
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: