You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On previous VSCode versions the TestExplorer would display the parametrized tests hanging from the test name's node regardless of this test being part of a test class or not. Since, at least, 2023 June release this is no longer the case and all parametrized tests will be directly appended to the class's tests.
(Perhaps related or consequence of the fix from #21541)
Steps to reproduce:
Create a python (discoverable) test file test_dummy.py.
Add the following code representing a loose test method and a wrapped one (both doing exactly the same):
importpytest@pytest.mark.parametrize("a", [pytest.param(0, id="Fist case for loose test"), pytest.param(1)])deftest_simple_dummy(a: int):
asserta==0classTestWrapper:
@pytest.mark.parametrize("a", [pytest.param(0, id="First case for wrapped test"), pytest.param(1)] )deftest_dummy(self, a: int):
asserta==0
The test cases for the "loose" test method (test_simple_dummy) will be correctly visualized in the test explorer, whilst the cases in the wrapped test class will be appended directly to the TestWrapper node. Result:
Expected behavior: the parametrized cases are represented always as individual nodes hanging from their parent test method regardless of the test method being part of a class or not.
Diagnostic data
Python version (& distribution if applicable, e.g. Anaconda): 3.10.11
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 (View→Output, change the drop-down the upper-right of the Output panel to Python)
Type: Bug
Behaviour
Expected vs. Actual
On previous VSCode versions the TestExplorer would display the parametrized tests hanging from the test name's node regardless of this test being part of a test class or not. Since, at least, 2023 June release this is no longer the case and all parametrized tests will be directly appended to the class's tests.
(Perhaps related or consequence of the fix from #21541)
Steps to reproduce:
test_dummy.py.test_simple_dummy) will be correctly visualized in the test explorer, whilst the cases in the wrapped test class will be appended directly to theTestWrappernode.Result:
Diagnostic data
python.languageServersetting: DefaultOutput for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)User Settings
Extension version: 2024.0.1
VS Code version: Code 1.86.0 (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T10:28:19.990Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments