profile
viewpoint

Ask questionsTest discovery failing from 0.3.5

Hello,

I back to your adapter and I discovered that plugin is not working for me. Last working version is 0.3.4.

Environment

Package                       Version
----------------------------- -----------
atomicwrites                  1.4.0
attrs                         19.3.0
backports.functools-lru-cache 1.6.1
configparser                  4.0.2
contextlib2                   0.6.0.post1
funcsigs                      1.0.2
importlib-metadata            1.6.1
more-itertools                5.0.0
packaging                     20.4
pathlib2                      2.3.5
pip                           20.1
pluggy                        0.13.1
py                            1.8.1
pyparsing                     2.4.7
pytest                        4.6.11
pytest-describe               1.0.0
scandir                       1.10.0
setuptools                    44.1.0
six                           1.15.0
wcwidth                       0.2.4
wheel                         0.34.2
zipp                          1.2.0

PyEnv

  • pyenv 1.2.18

Test 1

def test_false():
    assert True is False

Test 2

def describe_test_fail():
    def it_test_fail():
        assert True is False

Output from working version 0.3.4

2020-06-08T05:41:25.143Z info at 'test' [unittest runner]: Reading configuration for workspace test
2020-06-08T05:41:25.148Z info at 'test' [unittest runner]: Unittest test discovery is disabled
2020-06-08T05:41:25.148Z info at 'test' [pytest runner]: Reading configuration for workspace test
2020-06-08T05:41:25.153Z info at 'test' [pytest runner]: Environment variables file /home/chomicki/Repos/github/test/.env does not exist
2020-06-08T05:41:25.154Z info at 'test' [pytest runner]: Discovering tests using python path 'python' in /home/chomicki/Repos/github/test

Output from not working latest version

2020-06-08T05:42:24.103Z info at 'test' [unittest runner]: Reading configuration for workspace test
2020-06-08T05:42:24.105Z info at 'test' [unittest runner]: Unittest test discovery is disabled
2020-06-08T05:42:24.105Z info at 'test' [pytest runner]: Reading configuration for workspace test
2020-06-08T05:42:24.217Z info at 'test' [pytest runner]: Environment variables file /home/test/Repos/github/test/.env does not exist
2020-06-08T05:42:24.218Z info at 'test' [pytest runner]: Discovering tests using python path '/home/test/.pyenv/versions/testvscode/bin/python' in test
2020-06-08T05:42:24.218Z info at 'test' [pytest runner]: Running pytest wrapper with arguments: --collect-only
2020-06-08T05:42:24.237Z crit at 'test' [pytest runner]: Test loading failed: Error occurred during process execution: Error: spawn /home/test/.pyenv/versions/testvscode/bin/python ENOENT

Python settings in vscode

{
    "python.pythonPath": "/home/test/.pyenv/versions/testvscode/bin/python"
}

I checked the script embedded in the plugin and it is working if executed from separate file. I added some logging to plugin but looks like script is not executed at all because I don't see any debug logs (I wrote them into file). I'm on Manjaro latest version and I'm using zsh shell.

Thank you in advance for support. Pawel

kondratyev-nv/vscode-python-test-adapter

Answer questions kondratyev-nv

@pchomik Glad that you've got it working! I think I've got an idea of what is going wrong. One of the parts that differ in logs is the current working directory. Discovering tests using python path '...' in test vs Discovering tests using python path '...' in /home/user/Repos/github/test I've tried to set python.testing.cwd to a non-existing path and got the same error - ENOENT. So changing python.testing.cwd might help. And just to make sure, can you describe your folder structure? What folder is opened in VSCode and does test folder exists under the folder you've opened?

useful!

Related questions

No questions were found.
Github User Rank List