PYTHONPATH for unittest_discovery.py #20901
Unanswered
benbuckman
asked this question in
Q&A
Replies: 1 comment
-
Until we improve our |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm using:
Our application requires multiple paths set in
PYTHONPATH
to appease the assumptions of various frameworks.I'm having trouble getting this to work with the Tests panel and its
unittest_discovery.py
script.I've tried setting
PYTHONPATH
with an.env
file and withterminal.integrated.env.osx.PYTHONPATH
insettings.json
.If I hack
sys.stderr.write(f"{__file__} PYTHONPATH is: {os.environ.get('PYTHONPATH')}\n")
intounittest_discovery.py
, it prints outPYTHONPATH is: None
.Consequently, it's not finding all my tests, and it's showing
ModuleNotFound
errors.I see that a similar issue was raised in #17179 and concluded as not having sufficient backing. Is that the end of it?
I also see an earlier #17363 where it seems like a similar issue was fixed. So that's confusing.
What is the correct way to set
PYTHONPATH
for test discovery in the Testing panel? Or is there no way currently?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions