tonybaloney / pytest-freethreaded

MIT License
31 stars 3 forks source link

Setting threads and iterations to 1 results in tests running twice, once on main thread and once on ThreadPoolExecutor-0_0 #20

Open dan-glass opened 1 week ago

dan-glass commented 1 week ago
pytest --threads 1 --iterations 1

Output:

2024-11-14 04:39:40.249 WARNING MainThread  pytest_freethreaded.plugin.pytest_sessionstart      GIL is enabled, so tests will not be run truly in parallel
================================================================================================================================================================= test session starts ==================================================================================================================================================================
platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /transport
configfile: pytest.ini
plugins: freethreaded-0.1.0, timeout-2.3.1, env-1.1.5, cov-2.8.1
timeout: 30.0s
timeout method: signal
timeout func_only: False
collected 1 item

test_me.py::test_me
-------------------------------------------------------------------------------------------------------------------------------------------------------------------- live log setup --------------------------------------------------------------------------------------------------------------------------------------------------------------------
...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
2024-11-14 04:39:40.682 DEBUG MainThread  pytest_freethreaded.plugin.pytest_runtest_call        Running test test_me
2024-11-14 04:39:40.686 DEBUG ThreadPoolExecutor-0_0  test_me        test_me
2024-11-14 04:39:40.688 DEBUG MainThread  test_me    test_me