With unittest Enabled: No tests ran, please check the configuration settings for the tests.
See original GitHub issueEnvironment data
- VS Code version: Code 1.27.2 (f46c4c469d6e6d8c46f268d1553c5dc4b475840f, 2018-09-12T16:17:45.060Z)
- Extension version (available under the Extensions sidebar): 2018.8.0
- OS and version: Windows_NT x64 10.0.16299
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.5
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
I enabled Unit tests for my Python project using these Microsoft instructions: https://code.visualstudio.com/docs/python/unit-testing I’m using unittest and have explicitly disabled PyTest and Nose.
Actual behavior
Even though tests are passing, there is the Warning "No tests ran, please check the configuration settings for the tests."
:
Expected behavior
Tests to execute, no Warning, status to appear in the appropriate bar:
(I know it says Anaconda here, I was trying other stuff to debug this, but I’m using Vanilla python distro)
Steps to reproduce:
- This is tricky. I’ve disabled all extensions except vscode-python. The first time you run tests (select Run All Unit Tests) it seems to work.
- If you then open your test file and run the test cases individually by cliking in the editor: then “after a while” (sorry… try maybe 10 times?) of doing that, you will start to see the Warning appear.
- From that point on, no matter how many tests you execute, or how you execute them, the output will show that they ran but the bar will say otherwise.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Blank
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
console.ts:136 [Extension Host] Python Extension: Error: read ECONNRESET
t.log @ console.ts:136
t._logExtensionHostMessage @ extensionHost.ts:412
(anonymous) @ extensionHost.ts:224
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
log.ts:171 ERR Unexpected token C in JSON at position 101: SyntaxError: Unexpected token C in JSON at position 101
at JSON.parse (<anonymous>)
at Socket.socket.on (C:\Users\mgoyder\.vscode\extensions\ms-python.python-2018.8.0\out\client\unittests\unittest\socketServer.js:77:38)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:246:13)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:594:20)
console.ts:136 [Extension Host] ApplicationInsights:Sender [{…}]0: {code: "ETIMEDOUT", errno: "ETIMEDOUT", syscall: "connect", address: "64.4.54.254", port: 443}length: 1__proto__: Array(0)
t.log @ console.ts:136
t._logExtensionHostMessage @ extensionHost.ts:412
(anonymous) @ extensionHost.ts:224
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
Issue Analytics
- State:
- Created 5 years ago
- Reactions:54
- Comments:20 (4 by maintainers)
Top Results From Across the Web
VS Code Python unittest "No tests ran" - Stack Overflow
I read the unittest Basic Example there is not something about make tests files to a module. So that's Why you can see...
Read more >Can't find tests with pytest? "No tests discovered, please check ...
I get the following popup message from VSCode: No tests discovered, please check the configuration settings for the tests. My research tells me ......
Read more >unittest — Unit testing framework — Python 3.11.1 ...
It supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from...
Read more >unittest | Python in Visual Studio Code
Enable unittest framework. Assign the value true against the setting python.unitTest.unittestEnabled as outlined here. Ensure all other test frameworks have ...
Read more >Vs Code Python Unittest: No Tests Discovered Even When ...
With Unittest Enabled No Tests Ran Please Check The Configuration Settings For The Tests Issue 2660 Microsoft Vscode Python Github. With Unittest Enabled....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just verified that this still happens in the latest version, VS Code 1.32.3, on Windows. Python extension 2019.2.5558. As above, it happens sporadically. I had to press “Run Test” many times and then it started happening, and then it stopped appearing on its own again as well. It’s really flaky.
JFYI still happens (and quite frequently) on VS Code 1.28.1, Python extension 2018.9, and Python 3.6.3 64bit virtualenv