Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99552

Run Django tests in the VSCode Test explorer?

$
0
0

I am trying to run Django unit tests in the VSCode Test Explorer, also, I want the CodeLens 'Run Tests' button to appear above each test. enter image description here However, in the Test Explorer, When I press the Play button, an error displays: "No Tests were Ran"No Tests were Ran

My directory structure is:

  • Workspace_Folder
    • settings.json
    • repo
      • python_module_1
        • sub_module
          • tests
            • test_a.py

I am using the unittest framework. My Settings.json looks like this:

{
    "python.pythonPath": "/Users/nbonilla/.local/share/virtualenvs/koku-iTLe243o/bin/python",
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        "${workspaceFolder}/python_module_1/sub_module/"
    ],
    "python.testing.pytestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.unittestEnabled": true,
}

When I press the green "Play" button Test Explorer Play Button The Python Test Log Output shows the message "Unhandled exception in thread started by"Unhandled Exception in thread started by I am using a pipenv virtual environment. How do I run these Django Tests in the VSCode Test Explorer?

I saw that using pyTest is an alternative to unittest, how can this be set up easily as a replacement?


Viewing all articles
Browse latest Browse all 99552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>