Pytest doesn't respect PYTHONPATH in .env #6915
Labels
bug
Issue identified by VS Code Team member as probable bug
info-needed
Issue requires more information from poster
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): LanguageServerExpected behaviour
Test discovery and running have enviroment variables (including PYTHONPATH) declared in the .env file
Actual behaviour
Tests that depend on a specific environment variable being set to run fail.
Steps to reproduce:
Add new line in .env file (/home/singleheart/mywork is the location of my workspace)
PYTHONPATH=/home/singleheart/mywork
Create a settings file .vscode/settings.json with the following contents:
{
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true
}
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output for
Python Test Log
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Test Log
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)The text was updated successfully, but these errors were encountered: