Skip to content

Test discovery failed for pytest 4.2.0  #4409

@niksite

Description

@niksite

Environment data

  • VS Code version: 1.31.1
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: MacOS 10.14.3 (18D103)
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.15
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
  • Relevant/affected Python packages and their versions: pytest==4.2.0

Expected behaviour

Test discovery succeeded.

Actual behaviour

Test discovery failed:
image

Works well with pytest 4.0.2

Logs

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

Test Discovery failed: 
TypeError: Cannot read property 'item' of undefined

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2561 Test discovery error, please check the configuration settings for the tests.
t.onDidNotificationChange @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:2561
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:287 [Extension Host] Python Extension: displayDiscoverStatus TypeError: Cannot read property 'item' of undefined
	at module.exports.l.parsePyTestModuleCollectionResult.t.forEach.t (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:786559)
	at Array.forEach (<anonymous>)
	at l.parsePyTestModuleCollectionResult (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:785904)
	at module.exports.l.getTestFiles.e.split.forEach (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:784530)
	at Array.forEach (<anonymous>)
	at l.getTestFiles (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:784404)
	at l.parse (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:784191)
	at h.<anonymous> (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:783405)
	at Generator.next (<anonymous>)
	at s (/Users/sisuser/.vscode/extensions/ms-python.python-2019.1.0/out/client/extension.js:83:781847)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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