Reputation: 499
very similar to issue #8222 on the vscode-python github.com issues list, but that thread seemed dead, so I am opening a new one
Version: 1.39.2 (user setup)
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:35:18.241Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 6.1.7601
I am using VSCode Remote - SSH to do all dev and testing on a remote linux system, version 0.48.0
Using only the VSCode Python extension ms-python.python
version 2019.11.50794
I used to use the python test extension but that capability is now absorbed into the python extension, which is great
{
"python.pythonPath": "/local/me/opt/miniconda3/envs/deathstar/bin/python",
"python.testing.pytestArgs": [
"test",
"--disable-warnings",
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true,
}
$ python --version
Python 3.6.8 :: Anaconda, Inc.
$ python -c "import pytest;print(pytest.__version__)"
5.3.1
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.3.1, py-1.8.1, pluggy-0.13.1
rootdir: /home/me/project/project_name
collected 0 items
-------------- generated xml file: /tmp/tmp-304736fTj9ikMPptk.xml --------------
============================== 1 warning in 0.01s ==============================
ERROR: file not found: ./test_mything_plugin.py::test_get_conn
[Extension Host] Info Python Extension: 2019-12-31 20:10:20: Cached data exists ActivatedEnvironmentVariables, /home/tjones/project/airflow_etl
console.ts:137 [Extension Host] Info Python Extension: 2019-12-31 20:10:20: getActivatedEnvironmentVariables, Class name = b, completed in 1ms, Arg 1: <Uri:/home/tjones/project/airflow_etl>, Arg 2: undefined, Arg 3: undefined
console.ts:137 [Extension Host] Info Python Extension: 2019-12-31 20:10:20: > /local/tjones/opt/miniconda3/envs/airflow/bin/python -m pytest --rootdir ~/project/airflow_etl --junitxml=/tmp/tmp-1575s6J3FtN4Ho55.xml --disable-warnings ./test_bam_ctds_plugin.py::test_get_conn
console.ts:137 [Extension Host] Info Python Extension: 2019-12-31 20:10:20: cwd: ~/project/airflow_etl
_when I hit the debug button, I get nothing, but when I hit the Play button, I get this
> /local/tjones/opt/miniconda3/envs/airflow/bin/python -m pytest --rootdir ~/project/airflow_etl --junitxml=/tmp/tmp-1575D8SX75zh6k5j.xml --disable-warnings ./test_bam_ctds_plugin.py::test_get_conn
cwd: ~/project/airflow_etl
> /local/tjones/opt/miniconda3/envs/airflow/bin/python -m pytest --rootdir ~/project/airflow_etl --junitxml=/tmp/tmp-1575s6J3FtN4Ho55.xml --disable-warnings ./test_bam_ctds_plugin.py::test_get_conn
cwd: ~/project/airflow_etl
Upvotes: 2
Views: 2080
Reputation: 16080
Typically the code lenses for tests fail because either another extension interferes (e.g. gitlens) or the code isn't being picked up by IntelliSense (i.e. Jedi or the Microsoft Python Language Server). I would try turning off your other extensions and see if that solves the problem. I would also check that you get code completion in your tests files.
Upvotes: 1