2024-05-30 19:21:12.876 [info] Discover tests for workspace name: TestProject - uri: /Users/saurabhrai/AutomationProject/TestProject/tests/test_demo.py
2024-05-30 19:21:12.876 [info] Running discovery for pytest using the new test adapter.
2024-05-30 19:21:12.877 [info] All environment variables set for pytest discovery: {"COMMAND_MODE":"unix2003","HOME":"/Users/saurabhrai","JAVA_HOME":"/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home","LOGNAME":"saurabhrai","LaunchInstanceID":"5524BF1F-1C86-4267-9F65-5DF4B2AA5CBC","MallocNanoZone":"0","OLDPWD":"/","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","PWD":"/","SECURITYSESSIONID":"186a4","SHELL":"/bin/zsh","SHLVL":"0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.ukoMt4j0XS/Listeners","TMPDIR":"/var/folders/vm/_sszf9116zzd84s_20byyyk00000gp/T/","USER":"saurabhrai","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CODE_CACHE_PATH":"/Users/saurabhrai/Library/Application Support/Code/CachedData/dc96b837cf6bb4af9cd736aa3af08cf8279f7685","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"/","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"/Users/saurabhrai/Library/Application Support/Code/1.89-main.sock","VSCODE_NLS_CONFIG":"{\"locale\":\"en-gb\",\"osLocale\":\"en-in\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"597","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.74831843.74831849","_":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","__CFBundleIdentifier":"com.microsoft.VSCode","__CF_USER_TEXT_ENCODING":"0x1F6:0x0:0x0","ELECTRON_RUN_AS_NODE":"1","NODE_TLS_REJECT_UNAUTHORIZED":"0","PATH":"/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/saurabhrai/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/apache-maven/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin","PYTHONPATH":"/Users/saurabhrai/.vscode/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/var/folders/vm/_sszf9116zzd84s_20byyyk00000gp/T/python-test-discovery-4cf7184dd3ae031a7378.sock"}
2024-05-30 19:21:12.879 [info] > ~/Library/Caches/pypoetry/virtualenvs/unifiedapiframework-SVwGRVPg-py3.11/bin/python -m pytest -p vscode_pytest --collect-only .
2024-05-30 19:21:12.879 [info] cwd: .
2024-05-30 19:21:13.191 [info] ============================= test session starts ==============================
platform darwin -- Python 3.11.8, pytest-7.1.3, pluggy-1.0.0
2024-05-30 19:21:13.196 [info] rootdir: /Users/saurabhrai/AutomationProject/TestProject
plugins: rerunfailures-12.0, html-3.2.0, parallel-0.1.1, timeout-2.1.0, metadata-3.0.0, xdist-3.3.1, allure-pytest-2.13.2
2024-05-30 19:21:13.203 [info] collected 4 items
<Module tests/test_demo.py>
<Class TestClass1>
<Function test_method1[1]>
2024-05-30 19:21:13.203 [info]
<Class TestClass2>
<Function test_method1[1]>
<Class TestClass1>
<Function test_method1[2]>
<Class TestClass2>
<Function test_method1[2]>
2024-05-30 19:21:13.204 [info]
2024-05-30 19:21:13.205 [info] ========================== 4 tests collected in 0.01s ==========================
2024-05-30 19:21:33.113 [info] Discover tests for workspace name: TestProject - uri: /Users/saurabhrai/AutomationProject/TestProject/tests/test_demo.py
2024-05-30 19:21:33.114 [info] Running discovery for pytest using the new test adapter.
2024-05-30 19:21:33.115 [info] All environment variables set for pytest discovery: {"COMMAND_MODE":"unix2003","HOME":"/Users/saurabhrai","JAVA_HOME":"/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home","LOGNAME":"saurabhrai","LaunchInstanceID":"5524BF1F-1C86-4267-9F65-5DF4B2AA5CBC","MallocNanoZone":"0","OLDPWD":"/","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","PWD":"/","SECURITYSESSIONID":"186a4","SHELL":"/bin/zsh","SHLVL":"0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.ukoMt4j0XS/Listeners","TMPDIR":"/var/folders/vm/_sszf9116zzd84s_20byyyk00000gp/T/","USER":"saurabhrai","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CODE_CACHE_PATH":"/Users/saurabhrai/Library/Application Support/Code/CachedData/dc96b837cf6bb4af9cd736aa3af08cf8279f7685","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"/","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"/Users/saurabhrai/Library/Application Support/Code/1.89-main.sock","VSCODE_NLS_CONFIG":"{\"locale\":\"en-gb\",\"osLocale\":\"en-in\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"597","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.74831843.74831849","_":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","__CFBundleIdentifier":"com.microsoft.VSCode","__CF_USER_TEXT_ENCODING":"0x1F6:0x0:0x0","ELECTRON_RUN_AS_NODE":"1","NODE_TLS_REJECT_UNAUTHORIZED":"0","PATH":"/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/saurabhrai/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/apache-maven/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin","PYTHONPATH":"/Users/saurabhrai/.vscode/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/var/folders/vm/_sszf9116zzd84s_20byyyk00000gp/T/python-test-discovery-c930579b6bea281481ce.sock"}
2024-05-30 19:21:33.118 [info] > ~/Library/Caches/pypoetry/virtualenvs/unifiedapiframework-SVwGRVPg-py3.11/bin/python -m pytest -p vscode_pytest --collect-only .
2024-05-30 19:21:33.118 [info] cwd: .
2024-05-30 19:21:33.534 [info] ============================= test session starts ==============================
platform darwin -- Python 3.11.8, pytest-7.1.3, pluggy-1.0.0
2024-05-30 19:21:33.540 [info] rootdir: /Users/saurabhrai/AutomationProject/TestProject
plugins: rerunfailures-12.0, html-3.2.0, parallel-0.1.1, timeout-2.1.0, metadata-3.0.0, xdist-3.3.1, allure-pytest-2.13.2
2024-05-30 19:21:33.547 [info] collected 4 items
2024-05-30 19:21:33.547 [info] <Module tests/test_demo.py>
<Class TestClass1>
<Function test_method1[1]>
<Function test_method1[2]>
<Class TestClass2>
<Function test_method1[1]>
<Function test_method1[2]>
2024-05-30 19:21:33.549 [info]
========================== 4 tests collected in 0.01s ==========================
2024-05-30 19:21:51.150 [info] Discover tests for workspace name: TestProject - uri: /Users/saurabhrai/AutomationProject/TestProject
2024-05-30 19:21:51.150 [info] Running discovery for pytest using the new test adapter.
2024-05-30 19:21:51.151 [info] All environment variables set for pytest discovery: {"COMMAND_MODE":"unix2003","HOME":"/Users/saurabhrai","JAVA_HOME":"/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home","LOGNAME":"saurabhrai","LaunchInstanceID":"5524BF1F-1C86-4267-9F65-5DF4B2AA5CBC","MallocNanoZone":"0","OLDPWD":"/","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","PWD":"/","SECURITYSESSIONID":"186a4","SHELL":"/bin/zsh","SHLVL":"0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.ukoMt4j0XS/Listeners","TMPDIR":"/var/folders/vm/_sszf9116zzd84s_20byyyk00000gp/T/","USER":"saurabhrai","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_CODE_CACHE_PATH":"/Users/saurabhrai/Library/Application Support/Code/CachedData/dc96b837cf6bb4af9cd736aa3af08cf8279f7685","VSCODE_CRASH_REPORTER_PROCESS_TYPE":"extensionHost","VSCODE_CWD":"/","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_IPC_HOOK":"/Users/saurabhrai/Library/Application Support/Code/1.89-main.sock","VSCODE_NLS_CONFIG":"{\"locale\":\"en-gb\",\"osLocale\":\"en-in\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_PID":"597","XPC_FLAGS":"0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.74831843.74831849","_":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","__CFBundleIdentifier":"com.microsoft.VSCode","__CF_USER_TEXT_ENCODING":"0x1F6:0x0:0x0","ELECTRON_RUN_AS_NODE":"1","NODE_TLS_REJECT_UNAUTHORIZED":"0","PATH":"/Library/Frameworks/Python.framework/Versions/3.8/bin:/Users/saurabhrai/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/apache-maven/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin","PYTHONPATH":"/Users/saurabhrai/.vscode/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/var/folders/vm/_sszf9116zzd84s_20byyyk00000gp/T/python-test-discovery-9dd008b5c74d773103e2.sock"}
2024-05-30 19:21:51.154 [info] > ~/Library/Caches/pypoetry/virtualenvs/unifiedapiframework-SVwGRVPg-py3.11/bin/python -m pytest -p vscode_pytest --collect-only .
2024-05-30 19:21:51.154 [info] cwd: .
2024-05-30 19:21:51.486 [info] ============================= test session starts ==============================
platform darwin -- Python 3.11.8, pytest-7.1.3, pluggy-1.0.0
2024-05-30 19:21:51.492 [info] rootdir: /Users/saurabhrai/AutomationProject/TestProject
plugins: rerunfailures-12.0, html-3.2.0, parallel-0.1.1, timeout-2.1.0, metadata-3.0.0, xdist-3.3.1, allure-pytest-2.13.2
2024-05-30 19:21:51.497 [info] collected 4 items
<Module tests/test_demo.py>
<Class TestClass1>
2024-05-30 19:21:51.497 [info] <Function test_method1[1]>
<Function test_method1[2]>
<Class TestClass2>
<Function test_method1[1]>
<Function test_method1[2]>
2024-05-30 19:21:51.499 [info]
========================== 4 tests collected in 0.01s ==========================
Type: Bug
Behaviour
Multiple tests are displayed by test explorer when we have test function with same name in two different test class and both the test function shares some common fixture.
Steps to reproduce:
import pytest @pytest.fixture(scope="function", params=[1, 2]) def setup(request): return request.param class TestClass1: def test_method1(self, setup): assert 1 == 1class TestClass2:
def test_method1(self, setup):
assert 2 == 2
Test Explorer Output

Diagnostic data
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Extension version: 2024.6.0
VS Code version: Code 1.89.1 (Universal) (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:14:24.611Z)
OS version: Darwin x64 23.4.0
Modes:
Connection to 'tunnel+ci-va2-remote' could not be established
Connection to 'tunnel+qaint-va2-remote' could not be established
python.languageServersetting: DefaultUser Settings
Installed Extensions
System Info
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Connection to 'tunnel+ci-va2-remote' could not be established
Connection to 'tunnel+qaint-va2-remote' could not be established
A/B Experiments