Easy fix is to change docs to have "-n 4" instead of two args, but I don't understand why "-n", "4" is not working.
Environment data
- VS Code version: 1.35.1
- Extension version (available under the Extensions sidebar): 2019.7.21668-dev
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.1
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
- Relevant/affected Python packages and their versions:

Expected behaviour
"python.testing.pytestArgs": ["-n 4"] and "python.testing.pytestArgs": ["-n", "4"] should have the same behaviour, shouldn't it?
Actual behaviour
Having "python.testing.pytestArgs": ["-n", "4"] in settings.json throws an error:
pytest.py: error: argument -n/--numprocesses: invalid parse_numprocesses value: '.\\testing\\python\\approx.py'
and approx.py is the file from which I tried to execute the tests.
Steps to reproduce:
- Clone pytest repo
- Install dependencies if needed. Make sure pytest-xdist is installed
- Configure tests in the extension to use pytest framework and add
"python.testing.pytestArgs": ["-n", "4"] to settings.json file
- Open the test explorer
- Discover tests works
- Run all tests works
- Run an individual test file and watch the "There was an error in running the tests" prompt appear
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
=========================== short test summary info ===========================
FAILED testing/logging/test_formatter.py::test_colored_short_level - Assertio...
===================== 1 failed, 2 passed in 0.98 seconds ======================
Error: Error: cannot open file:///c%3A/Users/luabud/pytest/c. Detail: Unable to read file (Error: File not found (c:\Users\luabud\pytest\c))
Test Discovery failed:
TypeError: i.startsWith is not a function
Test Discovery failed:
TypeError: i.startsWith is not a function
python C:\Users\luabud\.vscode\extensions\ms-python.python-2019.7.21668-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- -s --cache-clear -n 4
ERROR: usage: pytest.py [options] [file_or_dir] [file_or_dir] [...]
pytest.py: error: argument -n/--numprocesses: invalid parse_numprocesses value: '.\\testing\\python\\approx.py'
Error: TypeError: Cannot read property 'testsuite' of null
Test Discovery failed:
TypeError: i.startsWith is not a function
Test Discovery failed:
TypeError: i.startsWith is not a function
Test Discovery failed:
TypeError: i.startsWith is not a function
python C:\Users\luabud\.vscode\extensions\ms-python.python-2019.7.21668-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- -s --cache-clear -n 4
ERROR: usage: pytest.py [options] [file_or_dir] [file_or_dir] [...]
pytest.py: error: argument -n/--numprocesses: invalid parse_numprocesses value: '.\\testing\\python\\integration.py'
Error: TypeError: Cannot read property 'testsuite' of null
Easy fix is to change docs to have "-n 4" instead of two args, but I don't understand why "-n", "4" is not working.
Environment data
Expected behaviour
"python.testing.pytestArgs": ["-n 4"]and"python.testing.pytestArgs": ["-n", "4"]should have the same behaviour, shouldn't it?Actual behaviour
Having
"python.testing.pytestArgs": ["-n", "4"]in settings.json throws an error:pytest.py: error: argument -n/--numprocesses: invalid parse_numprocesses value: '.\\testing\\python\\approx.py'and approx.py is the file from which I tried to execute the tests.
Steps to reproduce:
"python.testing.pytestArgs": ["-n", "4"]to settings.json fileLogs
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)