-
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
ModuleNotFoundError and can't run/debug unittest #17363
Comments
I have the same problem. If write "import my_pkg" to
|
Looks like the issue is with PYTHONPATH. essentially when we were running discovery using '-c' Python would add [''] to the front of @brettcannon What do you recommend we do here? insert '' to |
I have the same problem. Below is my {
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
]
} And I've found that the Any idea about why the "./test" becomes "/test"?? |
@helloybz Can you make sure that you are using latest python extension version: |
The cwd should still be the first entry in # In site-packages named `sys_path`.
import sys
if __name__ == '__main__':
print(sys.path)
|
This is using script, so no |
Hey @karthiknadig was there a resolution for this? I'm having the exact same issue, latest Python extension installed |
This particular issue is fixed. If you are seeing |
I was having the same issue, stumbled upon this page, and for those who still have the same problem: don't forget to run |
I still have this issue with |
With today's update (VS Code 1.61, Python Extension v2021.10.1317843341), test discovery is working again. Thanks! |
Environment data
1.60.0
2021.9.1218897484
pipenv --global
python.languageServer
setting: not setExpected behaviour
unittest
tests are automatically detected and show up in testing side bar"Actual behaviour
They do not, and I get:
Steps to reproduce:
While working on https://github.com/JEFuller/dataclasses-configobj
Running on
2021.9.1191016588
is ✅but updating to
2021.9.1218897484
is ❌I can switch between versions and the tests appear and disappear, as show above ⬆️
Logs
Output for
Python
in theOutput
panel >The text was updated successfully, but these errors were encountered: