vscode-python-test-adapter icon indicating copy to clipboard operation
vscode-python-test-adapter copied to clipboard

Problems when running from sidebar with shortcuts

Open Mr-Pepe opened this issue 5 years ago • 2 comments

I really like this extension, but I have problems using shortcuts to trigger actions on a selected test in the sidebar.

My system: Version: 1.50.1 Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a Date: 2020-10-13T14:44:48.716Z Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Linux x64 5.4.72-1-MANJARO

I use pytest.

When I select an entry in the test explorer UI, I get the following errors: test-explorer.debug or test-explorer.run: "Cannot read property 'collection' of undefined" test_explorer.show-source: "Cannot read property 'fileUri' of undefined"

Please let me know if you need more info.

Mr-Pepe avatar Oct 21 '20 16:10 Mr-Pepe

@Mr-Pepe Thank you for the issue! Can you please share a gif or screenshot of what happens? Also, have you looked at messages in Python Test Adapter Log in the Output panel?

kondratyev-nv avatar Oct 25 '20 18:10 kondratyev-nv

I am struggling to take a screen capture, but I'll try to explain in more detail. When I use my mouse to open the test explorer view and click on "show source" for a test, it takes me to the source code of the test, no problem. But when I map test-explorer.show-source to a shortcut, navigate to a test in the explorer view with the arrow keys and then use that shortcut, VS code shows a pop-up error message saying "Cannot read property 'fileUri' of undefined". The same happens for debugging and running a test. Mouse navigation works, shortcuts don't. The test adapter log doesn't output anything during this procedure, but initially shows this:

2020-10-29T09:10:37.183Z INFO unittest at 'project': Reading configuration for workspace project
2020-10-29T09:10:37.183Z  DBG unittest at 'project': usingNewInterpreterStorage feature flag is 'true'
2020-10-29T09:10:37.184Z INFO pytest at 'project': Reading configuration for workspace project
2020-10-29T09:10:37.184Z  DBG pytest at 'project': usingNewInterpreterStorage feature flag is 'true'
2020-10-29T09:10:39.095Z INFO unittest at 'project': Using auto-detected pythonPath /home/felipe/anaconda3/envs/thesis/bin/python
2020-10-29T09:10:39.096Z INFO pytest at 'project': Using auto-detected pythonPath /home/felipe/anaconda3/envs/thesis/bin/python
2020-10-29T09:10:39.100Z INFO unittest at 'project': Unittest test discovery is disabled
2020-10-29T09:10:39.123Z INFO pytest at 'project': Environment variables file /home/felipe/tmp/project/.env does not exist
2020-10-29T09:10:39.124Z INFO pytest at 'project': Discovering tests using python path '/home/felipe/anaconda3/envs/thesis/bin/python' in /home/felipe/tmp/project
2020-10-29T09:10:39.125Z INFO pytest at 'project': Running pytest with arguments: --collect-only, .
2020-10-29T09:10:39.126Z INFO pytest at 'project': Running pytest as a Python module

Mr-Pepe avatar Oct 29 '20 09:10 Mr-Pepe