Cannot evaluate expressions in debugger console when pytest is running with -n
If debugging a test normally (with pytest as default test runner) I can evaluate expressions in the console just fine. However, if running with -n (multiprocessed), I can't evaluate any outputs directly.
Is there a way around this, while still letting pytest read the pytest.ini file?
Please sign in to leave a comment.
Hi, could you please provide a pytest.ini sample and a screenshot of your run/debug configuration?
I will try to reproduce the issue locally.
The ini file only contains
My debug configuration is just the auto-generated config when clicking the arrow of a pytest-compatible function in PyCharm.
I get:
Probably requires additional setup. Could you provide your `pip freeze` output?
Additional testing plugins:
Thank you,
Trying reproduce the issue now, but it seems to work fine for me with a minimal code.
Could you show a minimal code snippet and steps to reproduce the issue?
Even a simple file like
with the added code
and then run in the debugger will trigger the multiprocessing worker from pytest.ini.
I've not found a way to setup the default Debug context configuration with options to ignore/use different parameters. Otherwise I'd have to specifically create a configuration for every test file (and there are lots).
Running a test starts:
Thank you,
Reproduced and reported https://youtrack.jetbrains.com/issue/PY-51084