Repository navigation
Closed
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Milestone
Description
Environment data
- VS Code version: 1.31.1
- Extension version (available under the Extensions sidebar): 2019.2.5416
- OS and version: W10 Enterprise 10.0.17134
- Python version (& distribution if applicable, e.g. Anaconda): 3.6
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: Extension
Expected behaviour
Run all unittests on file
Actual behaviour
Runs only the first unittest.
Steps to reproduce:
- Create an unittest class. (
class Class(unittest.TestCase):) - Add a method to test.
- Add another method to test.
- Click right mouse button.
- Click "Execute the current unittest file" (Translated from Portuguese, not sure if it's exactly how it shows.
- Just the first test will execute, ignoring all others.
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
test_instancia (test.test_api_infobip.InfobipTestCase) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)
[Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\Programas\servicosmsf_v2
console.ts:134 [Extension Host] Python Extension: Cached data exists ActivatedEnvironmentVariables, c:\Programas\servicosmsf_v2
console.ts:134 [Extension Host] Python Extension: getActivatedEnvironmentVariables, Class name = b, Arg 1: <Uri:c:\Programas\servicosmsf_v2>, Arg 2: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\Programas\servicosmsf_v2
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, extension-output-#5
Reacted by thornhillcody, Rob Miller, memeplex and b-long
Metadata
Metadata
Assignees
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Activity
damonallison commentedon Apr 12, 2019
+1 - I ran into this as well.
From the Test Side Bar, running tests from the
.pyfile will only run the first test (which I assume the "Python: Run Current Unit Test File" does.Running tests at the class level will execute all tests in the class.
Hope this helps.
DonJayamanne commentedon Apr 17, 2019
Damon Allison (@damonallison)
Please could you provide some sample code we can use to repro the issues at our end?
Thanks
damonallison commentedon Apr 19, 2019
Don Jayamanne (@DonJayamanne)
You bet - run the tests in this repo. https://github.com/damonallison/python-examples
The screenshots I posted were from this repo, so they should look familiar. Let me know if you're not able to repro it. Thanks!
DonJayamanne commentedon Apr 22, 2019
Awesome, I can replicate this at my end, thanks.
Add news entry for microsoft#4567
kondratyev-nv commentedon Oct 5, 2019
I've run at this issue as well. I've created a file
test_add.pywith the following testsAnd in the logs I can see that command line specifies the test to run.
By the log it looks like the file node has an incorrect
nameToRunvalue, so I've modifiedTestsParserfor unittest. Please see PR #7783.4 remaining items
ericsnowcurrently commentedon Oct 21, 2019
N Kondratyev (@kondratyev-nv), FYI I plan on taking a look at your PR in the next few days.
kondratyev-nv commentedon Oct 22, 2019
Thank you! I look forward to it.
Fix the "nameToRun" for test files in unittest results. (#7783)
karrtikr commentedon Nov 7, 2019
Validated, thanks again N Kondratyev (@kondratyev-nv)
ericsnowcurrently commentedon Nov 8, 2019
Luciana Abud (@luabud), happy now? 😁️