-
Notifications
You must be signed in to change notification settings - Fork 1.2k
custom pytest wrapper in python.testing.pytestPath not working #18826
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
Comments
Hi @TallJimbo, thank you for reaching out. Instead of using a wrapper, is it possible for you to add your paths to Alternatively, can you expand |
I'm actually doing both already, and neither is working for pytest, and that's the only reason I resorted to the wrapper. They do work for the language server and flake8 (specifically, the .env file alone is sufficient, because it's all I do when I work remotely). I'm not sure at all why pytest is different; works fine from the command-line, and it looks like flake8 is also being invoked by vscode via |
Ah, I read
as meaning a VSCode |
Passing a I think that means I need either the |
According to this StackOverflow answer you can do the following:
Would that work? Other than that, the We also have an open feature request to set env variables specific to the test runner, feel free to upvote it to help us prioritize it: #17171 |
Thanks for digging it up, but I think the So, with that in mind, I set out trying to create a minimal how-to-reproduce and (as is often the case) discovered that my original diagnosis was pretty inaccurate:
I'll keep digging into this - I do prefer to launch from a terminal with the right environment in order to get another extension working. But I won't be doing it quickly, so I'm closing this on the assumption that if I do encounter a real problem in VSCode later, it'll be substantially different from what I originally reported here and a new issue would make sense. Thanks! |
Issue Type: Bug
Behaviour
Expected vs. Actual
I have some Python dependencies satisfied by a conda environment (which provides my Python interpreter) and some in directories in PYTHONPATH, and have created a .env file accordingly.
Pytest discovery fails because modules in PYTHONPATH are not importable, and as a workaround I attempted to create a wrapper around pytest. Setting python.testing.pytestPath to this wrapper has no effect; my custom wrapper does not appear in the "Output: Python" logs at all.
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultUser Settings
Extension version: 2022.4.0
VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T15:36:26.048Z)
OS version: Linux x64 5.10.0-1057-oem
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: