Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Discovery - TypeError: Cannot read property 'functions' of undefined #5720

Closed
amittleider opened this issue May 22, 2019 · 2 comments
Closed
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@amittleider
Copy link

When running the discover on Nosetests, I receive an error for some workspaces saying "Test Discover Failed. TypeError: Cannot read property 'functions' of undefined."

There was a time in the past when the test discovery did work on this particular workspace, but my codebase has changed and so has the python extension.

There is a related issue here: #5458 but that issue looks related to pytest extensions. My setup is using Nosetests instead.

The full exception is:

Python Extension: displayDiscoverStatus TypeError: Cannot read property 'functions' of undefined
	at module.exports.h.parseNoseTestModuleCollectionResult.t.forEach.t (/home/mitt/.vscode/extensions/ms-python.python-2019.4.12954/out/client/extension.js:83:821676)
	at Array.forEach (<anonymous>)
	at h.parseNoseTestModuleCollectionResult (/home/mitt/.vscode/extensions/ms-python.python-2019.4.12954/out/client/extension.js:83:819869)
	at module.exports.h.getTestFiles.e.split.forEach (/home/mitt/.vscode/extensions/ms-python.python-2019.4.12954/out/client/extension.js:83:819494)
	at Array.forEach (<anonymous>)
	at h.getTestFiles (/home/mitt/.vscode/extensions/ms-python.python-2019.4.12954/out/client/extension.js:83:819375)
	at h.parse (/home/mitt/.vscode/extensions/ms-python.python-2019.4.12954/out/client/extension.js:83:819187)
	at h.discoverTests (/home/mitt/.vscode/extensions/ms-python.python-2019.4.12954/out/client/extension.js:83:818407)
t.log @ workbench.main.js:238

Environment data

  • VS Code version: 1.34.0
  • Extension version (available under the Extensions sidebar): 2019.4.12954 (and tried on 2019.1.0 as well, but the exception occurs here as well)
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: nosetests

Expected behaviour

Discover the unit tests

Actual behaviour

Doesn't discover the unit tests

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 22, 2019
@DonJayamanne DonJayamanne self-assigned this May 22, 2019
@DonJayamanne DonJayamanne removed triage-needed Needs assignment to the proper sub-team labels May 22, 2019
@DonJayamanne
Copy link

DonJayamanne commented May 23, 2019

@amittleider I'm sorry to hear about this issue. As this is an issue that occurs in some workspaces and not others, its possible the code has hit some edge case or the like.
Please could you provide a sample repo we can use to replicate this at our end.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster area-testing bug Issue identified by VS Code Team member as probable bug labels May 28, 2019
@amittleider
Copy link
Author

I'm closing this, the problem was with my workspace configuration having an invalid nosetests argument.

@ghost ghost removed the triage label Jun 17, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants