-
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
Allow pytest to be invoked as a module #7207
Comments
Hello @thirtytwobits 👋 Thank you for reaching out! Are you referring to #7210 here:
The pytest documentation suggests using a In any case, this issue is now marked as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes your idea gets to help us make our decision. |
Hmm. I'm on a macintosh and I am always using an active virtualenv. I wonder if this is problem either specific to my platform or to code sessions using a virtualenv? I'll try the conftest.py solution to see if that helps. |
conftest.py doesn't help me. Thanks though. #7210 getting fixed would provide a solution though. |
That's pretty strange, because I'm on macOS too and |
The extension already allows pytest to be invoked as a module, as long as you don't specify pytestPath. @thirtytwobits Do you still have the issue regarding environment variables? |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off. |
I have tests in my Python project (Nunavut) that use a shared fixture that requires the "test" directory be on the sys path. Our tox scripts invoke pytest like thus:
Which ensures that test/fixtures gets added to the sys path. Can we add a feature to allow the test discovery and execution panel to invoke pytest (or other test modules) as a module starting from the cwd (where cwd is configurable as python.testing.cwd? So this would have the same effect as:
Either that or allow .env files to set
PYTHONPATH
which doesn't seem to work either. As it stands there doesn't seem to be a way to run the pytests for https://github.com/UAVCAN/nunavut in vscode without manually setting up a task.The text was updated successfully, but these errors were encountered: