Skip to content

Pytest cannot discover tests #8123

Closed
Closed

Description

@awav

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

Activity

  1. added
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on Oct 21, 2019
  2. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Oct 21, 2019
  3. karthiknadig commented on Oct 22, 2019

    @karthiknadig
    Member

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

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

  4. luabud commented on Oct 22, 2019

    @luabud
    Member

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

  5. locked as resolved and limited conversation to collaborators on Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions