forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
UnitTests
Don Jayamanne edited this page Sep 8, 2016
·
5 revisions
The following Unit Test frameworks are supported:
- If using Nose or PyTest, then ensure this test framework is installed in the currently configured Python interpreter.
- If not installed errors would be displayed in the
Python Test Logoutput panel.
UnitTests are turned off by default. Unit Testing of Python code is supported by enabling one of the above Unit Tests via the user or workspace settings files (settings.json), as follows:
- Open the user or workspace settings file (settings.json)
- Pick a unit test framework and enable one of them as follows:
// Place your settings in this file to overwrite default and user settings.
{
"python.unitTest.pyTestEnabled": true,
"python.unitTest.unittestEnabled": false,
"python.unitTest.nosetestsEnabled": falseNote: Use the value true to enable a particular unit test framework and false to disable.
Tests can be run (executed) a number of ways.
- Click the
Run Testsstatusbar button and select any one of the options such asRun All Testsin the subsequent list of options displayed. - Select a file from the explorer and from the context menu select
Run Unit Tests - Open a test file and click the
Testcode lens.
