Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest "Go to Test" open wrong file after moving project folder #20422

Closed
Slope86 opened this issue Dec 22, 2022 · 9 comments
Closed

pytest "Go to Test" open wrong file after moving project folder #20422

Slope86 opened this issue Dec 22, 2022 · 9 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@Slope86
Copy link

Slope86 commented Dec 22, 2022

Type: Bug

Behaviour

Expected vs. Actual

project folder before moving: ~\coding\python\Quantum
project folder after moving: ~\coding\python\Quantum\Qiskit-Extention

Expected: the "Go to Test" button open test_xxx.py under ~\coding\python\Quantum\Qiskit-Extention\tests
Actual: the "Go to Test" button try to open test_xxx.py under ~\coding\python\Quantum\tests

similar to issue pytest path breaks after renaming project folder #13820
have tried deleting the .pytest_cache folder and running pytest --cache-clear in the terminal, but didn't solve it.

Steps to reproduce:

  1. create a project folder
  2. write a test_xxx.py and run the test
  3. move the project folder
  4. open vscode Testing badge
  5. change "View as Tree" to "View as List"
    Video demo

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Experiment 'pythonaa' is active
Experiment 'pythonSurveyNotificationcf' is active
LSP Notebooks experiment is enabled
LSP Notebooks interactive window support is enabled
Python interpreter path: .\.conda\python.exe
> conda info --json
Starting Pylance language server.
> ~\.conda\Scripts\conda.exe info --json
> ~\miniforge3\Scripts\conda.exe info --json
> ~\miniforge3\condabin\conda.bat info --json
Send text to terminal: conda activate C:\Users\user\Documents\MyFiles\Coding\Python\Quantum\Qiskit-Extention\.conda
Send text to terminal: conda activate C:\Users\user\Documents\MyFiles\Coding\Python\Quantum\Qiskit-Extention\.conda
> ~\miniforge3\Scripts\conda.exe run -p .\.conda --no-capture-output python ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/printEnvVariables.py
> ~\AppData\Local\Programs\Python\Python310\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> .\.conda\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\envs\netqasm\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\envs\py311\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\envs\qnet\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\envs\simulaqron\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\envs\test\python.exe ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\interpreterInfo.py
> ~\miniforge3\Scripts\conda.exe run -p .\.conda --no-capture-output python ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/printEnvVariables.py
> ~\miniforge3\Scripts\conda.exe run -p .\.conda --no-capture-output python ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.20.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
cwd: .

User Settings


languageServer: "Pylance"

linting
• enabled: false
• flake8Enabled: true

formatting
• provider: "black"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Extension version: 2022.20.1
VS Code version: Code 1.74.2 (e8a3071ea4344d9d48ef8a4df2c097372b0c5161, 2022-12-20T10:29:14.590Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904)
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
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.80GB (4.91GB free)
Process Argv C:\Users\user\Documents\MyFiles\Coding\Python\Quantum\Qiskit-Extention --crash-reporter-id ab3a40f5-c454-4901-b5a7-aedff8a0a834
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
pyindex848cf:30577861
nodejswelcome1cf:30587006
2e4cg342:30602488
gswce1:30612156
3d0df643:30613357
f6dab269:30613381
fim-prod:30623723
vscsbc:30628655

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 22, 2022
@brettcannon
Copy link
Member

Did this not work after a restart of VS Code?

@Slope86
Copy link
Author

Slope86 commented Jan 4, 2023

@brettcannon No, still did not work after a restart of VS Code.
I tried again today and find out that, this bug only happens when the 【Testing badge】 setting "View as Tree" change to "View as List".

I also recorded a video reproduceing this bug

@eleanorjboyd
Copy link
Member

Thank you for the video that is extremely helpful! I will look into this, thanks!

@eleanorjboyd
Copy link
Member

Hello @connor4312, what are your thoughts on this bug. It seems to only occur when switching between tree view and list view which I think is in your domain in the general test UI but let me know if that is not the case.

@connor4312 connor4312 added the bug Issue identified by VS Code Team member as probable bug label Jan 9, 2023
@ainar
Copy link

ainar commented Apr 18, 2023

I'm facing the same bug. Is there a workaround to make the tests work again? A cache folder to delete?

@ghost
Copy link

ghost commented Apr 24, 2023

I had a similar problem and was able to fix it by removing VS Code cache.
On Windows go to %AppData% and in Code folder remove folders: Cache, CachedData and Code Cache

@ainar
Copy link

ainar commented Apr 24, 2023

I fixed it by deleting the pycache folders.

@eleanorjboyd
Copy link
Member

Yes, that is a great suggestion for deleting the cache, @Slope86 please give that a try and let us know. Thanks!

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 25, 2023
@brettcannon
Copy link
Member

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.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

5 participants