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

Pytest cannot discover tests #8123

Closed
awav opened this issue Oct 21, 2019 · 2 comments
Closed

Pytest cannot discover tests #8123

awav opened this issue Oct 21, 2019 · 2 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug

Comments

@awav
Copy link

awav commented Oct 21, 2019

Version: 1.39.2
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:33:00.827Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0
python.jediEnabled: False

Hello everyone,

The vscode cannot discover tests in my python project. I found that "Python Test Log" has empty error message (you can ignore tensorflow errors).

python /Users/artemav/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s ./tests
Test Discovery failed: 
Error: 2019-10-21 16:35:04.172030: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-10-21 16:35:04.182567: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f821b09eff0 executing computations on platform Host. Devices:
2019-10-21 16:35:04.182589: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
2019-10-21 16:35:04.744358: W tensorflow/python/util/util.cc:299] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.

I have a pretty standard setup for the python project. You can check it here: https://github.com/GPflow/GPflow/tree/develop-2.0. If I run the script for discovering tests which is used by vscode, it works fine in the terminal and exists without an error:

→ python /Users/artemav/.vscode/extensions/ms-python.python-2019.10.41019/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s ./tests
2019-10-21 16:56:25.587619: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-10-21 16:56:25.605854: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fae5c31c680 executing computations on platform Host. Devices:
2019-10-21 16:56:25.605880: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
2019-10-21 16:56:26.194016: W tensorflow/python/util/util.cc:299] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
[{"rootid": ".", "root": "/Users/artemav/code/GPflow", "parents": [{"id": "./tests", "kind": "folder", "name": "tests", "parentid": ".", "relpath": "./tests"}, {"id": "./tests/test_broadcasted_conditionals.py", "kind": "file", "name": "test_broadcasted_conditionals.py", "parentid": "./tests", "relpath": "./tests/test_broadcasted_conditionals.py"}...
→ echo $?
0
@awav awav added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Oct 21, 2019
@karthiknadig karthiknadig self-assigned this Oct 21, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Oct 21, 2019
@karthiknadig
Copy link
Member

const spawnOptions: SpawnOptions = {
token: options.token,
cwd: options.cwd,
throwOnStdErr: true
};

Looks like the throwOnStdErr: true causes this. @DonJayamanne I am guessing this is set to true to avoid issues with parsing/test runs after discovery? or can be be false. @luabud Should this be a option?

@luabud
Copy link
Member

luabud commented Oct 22, 2019

Closing in favour of #6594 since that would fix this issue :)

@luabud luabud closed this as completed Oct 23, 2019
@ghost ghost removed the needs decision label Oct 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 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
Projects
None yet
Development

No branches or pull requests

3 participants