microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.31k stars 1.18k forks source link

Python test file cannot be found (pytest) #22356

Closed Debianov closed 7 months ago

Debianov commented 11 months ago

Type: Bug

The pytest tests are actually running file, but when I click on "Go to test" in "Testing" bar, it cannot find the associated file. I get an error saying "The editor could not be opened because the file was not found". An error occurred after changing the test tree directory.

The tree directory before: test_commands --init.py --conftest.py --test_commands.py init.py conftest.py test_help.py (https://github.com/GREEN-Corporation/discord-bot/tree/4b94aa1f8794c396bd4030a919ace86e1d96df5a/tests)

The tree directory after: test_commands -- init, conftest, ...py test_converters -- the same test_help -- the same init.py conftest.py (https://github.com/GREEN-Corporation/discord-bot/tree/main/tests)

Extension version: 2023.14.0 VS Code version: Code 1.79.0 (b380da4ef1ee00e224a15c1d4d9793e27c2b6302, 2023-06-07T14:28:44.251Z) OS version: Linux x64 6.3.6-100.fc37.x86_64 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 1600 Six-Core Processor (12 x 3688)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|5, 3, 2| |Memory (System)|15.55GB (10.00GB free)| |Process Argv|--unity-launch --crash-reporter-id 8b70c53a-aeca-42e6-9030-16aba7437398| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|gnome| |XDG_CURRENT_DESKTOP|GNOME| |XDG_SESSION_DESKTOP|gnome| |XDG_SESSION_TYPE|wayland|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30856253 vscaac:30438847 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 282f8724:30602487 f6dab269:30613381 2i9eh265:30646982 showlangstatbar:30737416 962ge761:30841074 a2ce3375:30757347 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 copilotsettingc:30859502 synctok:30869157 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixtcf:30871695 pythonregdiag2:30871582 pyreplss1:30865275 pythonmypyd1:30859726 h48ei257:30870396 pythontbext0cf:30864173 ```
eleanorjboyd commented 11 months ago

Hi! What do you mean by An error occurred after changing the test tree directory.? Which is the root of the workspace and what setting are you checking to change the directory? Also when you click "Go to test" what file path does it attempt to take you to?

Thanks!

Debianov commented 11 months ago

Changing the test tree directory is renaming some files, adding a new folder. I didn't understand the last questions. I just click "Go to Test" any test file and see the error. When I debug a test, the same error occurs when VSCode try to pass to breakpoints. Before change of the tests directory this didn't was. That said, I can navigate through Explorer Bar to these tests and they exist.

A same bug.

eleanorjboyd commented 8 months ago

Hi @Debianov, I apologies on my absence from this thread. Are you still experiencing this issue?

brettcannon commented 7 months ago

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.