This section outlines the details necessary to get you up and started with using the pytest testing framework with Visual Studio Code.
Assign the value true
against the setting python.unitTest.pyTestEnabled
as outlined here.
Ensure all other test frameworks have been disabled (i.e. have the value false
).
Ensure pytest has been installed in the currently configured python environment.
Command line options
Command line options for the pytest can be passed by adding the necessary options into the following section in the user or workspace settings file settings.json
:
"python.unitTest.pyTestArgs": [
"--exitfirst",
"--verbose"
],
Note:
Configuration File
The use of a configuration file such as pytest.ini
is also supported.
Details on the configuration files and options can be found here
This section outlines the details necessary to get you up and started with using the pytest testing framework with Visual Studio Code.
Assign the value true
against the setting python.unitTest.pyTestEnabled
as outlined here.
Ensure all other test frameworks have been disabled (i.e. have the value false
).
Ensure pytest has been installed in the currently configured python environment.
Command line options
Command line options for the pytest can be passed by adding the necessary options into the following section in the user or workspace settings file settings.json
:
"python.unitTest.pyTestArgs": [
"--exitfirst",
"--verbose"
],
Note:
Configuration File
The use of a configuration file such as pytest.ini
is also supported.
Details on the configuration files and options can be found here