No test discovery functionality when using unittest on macOS #14962
Comments
|
Hi @jdwestbrook, thank you for reporting this issue! I could replicate your issue in these cases:
Where triggering test-related commands from the command palette (Discover Tests, Run Tests...) doesn't do anything. Feel free to upvote your comment to help us prioritize this issue. Thanks! |
|
@jdwestbrook which operating system are you using? |
|
macOS Big Sur on a mac book pro 2018 - |
|
Hmmm others couldn't repro the issue on Windows, seems to be a Mac-specific issue so far. I'll update the title. Thanks! |
|
Not fixed in the latest insiders update. |
|
Hi @jdwestbrook, we haven't fixed the issue yet. It has a "needs spike" label, which means that we'll have to investigate it first, to see what causes it to happen. It's on the table though, we have plans to get to it soon |
|
Update: The problem happens in at the factory function that creates the UnitTestTestManager instance: vscode-python/src/client/testing/serviceRegistry.ts Lines 173 to 175 in 86d556f
|
|
Hi @jdwestbrook, this should be fixed with 4d1037b, feel free to give the next Insiders build a try! You can also download the VSIX directly from this page. Thanks! |
|
No, I am afraid this is still broken in for the latest insiders build of Jan 6. |
|
Do you have a sample repo I can use to try and replicate the issue? |
|
Here is a link to a public repo - https://github.com/rcsb/py-rcsb_utils_io.git If you open any test the path rcsb/utils/tests-io/test*.py. you will note that the "run tests" item in Thanks for your help with this -- As an aside the latest update does fix the problem with automatic restart after My settings.json file is inline below - |
|
Thank you for the repo link! Sadly I couldn't reproduce the issue, tests were discovered whether I was using VS Code stable or Insiders: I used version 2021.1.464638477-dev of the Python extension, and this version of VS Code Insiders: Version: 1.53.0-insider
It it available if you use the command palette (cmd + shift + p): |
|
I continue to have issues with tests and test discovery. I attach the test window. Activating the discover test button on the top menu results in the warning message below but now other indication in the logs that it tried to run some [2021-01-11 13:48:55.565] [exthost] [warning] DiagnosticCollection with name 'unittest' does already exist. If I try to run all tests from the test menu in the attached figure, I get the stack trace shown in the image and no tests are run. It appears that that testing is completely broken for my install on BigSur 11.1 and several versions of python ranging from 3.8.2-6 to 3.9.1. |
|
In this screenshot you are using version Set the |
|
Brilliant!! That has resolved my issue.... Thanks very much for your help with this! |
|
Glad to hear it works now |






The latest insiders build has lost test discover functionality. The bottom window bar has no "run tests" item displayed. No controls are available to discover tests and provide run/debug options in test scripts. This is the second bulld recently with this issue.
settings.json
{ "python.pythonPath": "/usr/local/pyenv-root/versions/3.9.0/bin/python", "python.formatting.provider": "black", "python.testing.unittestArgs": [ "-v", "-s", ".", "-p", "test*.py" ], "python.testing.pytestEnabled": false, "python.testing.nosetestsEnabled": false, "python.testing.unittestEnabled": true }The text was updated successfully, but these errors were encountered: