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 fails #10497

Closed
lseongjoo opened this issue Mar 9, 2020 · 2 comments
Closed

Test discovery fails #10497

lseongjoo opened this issue Mar 9, 2020 · 2 comments
Labels
area-testing bug Issue identified by VS Code Team member as probable bug

Comments

@lseongjoo
Copy link

lseongjoo commented Mar 9, 2020

Environment data

  • VS Code version: 1.42.1
  • Extension version (available under the Extensions sidebar): 2020.2.64397
  • OS and version: MacOS 10.15.3
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.4 (Conda 4.8.1)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Docker Desktop for Mac 2.2.0
  • Relevant/affected Python packages and their versions: pytest 5.3.5
  • Relevant/affected Python-related VS Code extensions and their versions: Remote - Containers 0.101.1 Remote - SSH 0.49.0

Expected behaviour

Discovers pytest tests.

Actual behaviour

Test discovery fails. Pytest succeeds in CLI.

Steps to reproduce:

  1. Suspects the problem occurs when some dependency module's API __del__ returns None

Logs

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

Traceback (most recent call last):
  File "/root/.vscode-server/extensions/ms-python.python-2020.2.64397/pythonFiles/testing_tools/run_adapter.py", line 15, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/root/.vscode-server/extensions/ms-python.python-2020.2.64397/pythonFiles/testing_tools/adapter/__main__.py", line 87, in main
    parents, result = run(toolargs, **subargs)
  File "/root/.vscode-server/extensions/ms-python.python-2020.2.64397/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 39, in discover
    raise Exception("pytest discovery failed (exit code {})".format(ec))
Exception: pytest discovery failed (exit code 2)
Exception ignored in: <function DepedencyApi.__del__ at 0x7fe187dea9e0>
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/dependency/module.py", line 179, in __del__
  File "/opt/conda/lib/python3.7/site-packages/dependency/module.py", line 210, in close
TypeError: 'NoneType' object is not callable

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)

Traceback (most recent call last):
  File "/root/.vscode-server/extensions/ms-python.python-2020.2.64397/pythonFiles/testing_tools/run_adapter.py", line 15, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/root/.vscode-server/extensions/ms-python.python-2020.2.64397/pythonFiles/testing_tools/adapter/__main__.py", line 87, in main
    parents, result = run(toolargs, **subargs)
  File "/root/.vscode-server/extensions/ms-python.python-2020.2.64397/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 39, in discover
    raise Exception("pytest discovery failed (exit code {})".format(ec))
Exception: pytest discovery failed (exit code 2)
Exception ignored in: <function DepedencyApi.__del__ at 0x7fe187dea9e0>
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/dependency/module.py", line 179, in __del__
  File "/opt/conda/lib/python3.7/site-packages/dependency/module.py", line 210, in close
TypeError: 'NoneType' object is not callable

at ChildProcess.<anonymous> (/root/.vscode-server/extensions/ms-python.python-2020.2.64397/out/client/extension.js:1:455844)
    at Object.onceWrapper (events.js:288:20)
    at ChildProcess.emit (events.js:200:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:200:13)
    at Pipe.<anonymous> (net.js:586:12)]
@lseongjoo lseongjoo added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Mar 9, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Mar 12, 2020
@ericsnowcurrently
Copy link
Member

@lseongjoo, thanks for letting us know about this. We'll get back to you as soon as we can.

@ericsnowcurrently
Copy link
Member

@lseongjoo, anything written to stderr while discovery is running will cause it to fail. (Unlike pytest itself, the extension does not ignore failures.)

We have plans for making extraneous output a non-issue. See #6594. Until then, there isn't much we can do about this problem.

@ericsnowcurrently ericsnowcurrently removed their assignment Mar 24, 2020
@ghost ghost removed the triage label Mar 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 2020
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
Projects
None yet
Development

No branches or pull requests

3 participants