question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Execute the current unittest file not executing all tests

See original GitHub issue

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:

  1. Create an unittest class. (class Class(unittest.TestCase):)
  2. Add a method to test.
  3. Add another method to test.
  4. Click right mouse button.
  5. Click “Execute the current unittest file” (Translated from Portuguese, not sure if it’s exactly how it shows.
  6. Just the first test will execute, ignoring all others.

Logs

Output for Python in the Output panel (ViewOutput, 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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ericsnowcurrentlycommented, Nov 8, 2019

@luabud, happy now? 😁️

1reaction
DonJayamannecommented, Apr 22, 2019

Awesome, I can replicate this at my end, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python unittest does not run tests - Stack Overflow
In general, how can I run all unit tests from command line with a single line? The structure of the directory is demo...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
Some users will find that they have existing test code that they would like to run from unittest , without converting every old...
Read more >
Run tests | PyCharm Documentation - JetBrains
Right-click a test file or test class in the Project tool window or open it in the editor, and right-click the background. From...
Read more >
Running tests through command-line with run-tests.sh - Drupal
This usually means the test runner's browser is not working. Make sure your web server is running and you have passed a correct...
Read more >
Run set of tests - MATLAB runtests - MathWorks
When your current folder is a project root folder or when you pass the path to a project root folder to the runtests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found