Skip to content

Error when running tests: Cannot read property 'testsuites' of null #14107

@VaustXIII

Description

@VaustXIII

Environment data

  • VS Code version: 1.49.2 (user setup)
  • Extension version (available under the Extensions sidebar): v2020.9.111407
  • OS and version: Windows_NT x64 10.0.18363
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.9 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: pytest==6.0.2
  • Value of the python.languageServer setting: Pylance

Expected behaviour

Test are run after >Python: Run All Tests command

Actual behaviour

There is an error when running the tests.
Command 'Python: Run All Tests' resulted in an error (Cannot read property 'testsuites' of null)
Output: c:\Users\Vaust XIII\AppData\Local\Programs\Python\Python37\python.exe: can't open file '"c:/Users/Vaust XIII/.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py"': [Errno 22] Invalid argument
Error: TypeError: Cannot read property 'testsuites' of null

Steps to reproduce:

Test have been running fine, then I added a new one and started getting this error. I tried deleting the new test, but it didn't help, the error is still there

hello.py

def hello():
    return "Hello"

hello_test.py

from hello import *

def test_hello():
    assert hello() == "Hello"

Additional info

The >Python: Debug All Tests command works fine. Tests are run, I can debug them, message "x passed in y" is printed to Debug Console

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

> ~\AppData\Local\Programs\Python\Python37\python.exe "c:/Users/Vaust XIII/.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py" pytest --override-ini junit_family=xunit1 --rootdir e:\python\foo --junit-xml=C:\Users\VAUSTX~1\AppData\Local\Temp\tmp-2288ORjzo6SAoZsg.xml .
cwd: e:\python\foo
> ~\AppData\Local\Programs\Python\Python37\python.exe "c:/Users/Vaust XIII/.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py" pytest --override-ini junit_family=xunit1 --rootdir e:\python\foo --junit-xml=C:\Users\VAUSTX~1\AppData\Local\Temp\tmp-2288ORjzo6SAoZsg.xml .
cwd: e:\python\foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions