Closed keen85 closed 1 year ago
Hi @keen85
Thanks for the report. With only a cursory glance, it seems like xdist could be hard to support: the plugin seems to start separate processes for parallelization. However a lot of the ipytest functionality relies on modifying the current interpreter state. I fear that there could be no way to pass forward this modified state to the started processes.
I will have a closer look at how python-xdist works in the coming days and investigate in detail what's going on.
@keen85 unfortunately I'm pretty sure it's not possible to support pytest-xdist in ipytest. In their "how it works" section, it states explicitly that the collection is done in each worker thread. However, the tests defined inside the notebook are only available in the main process.
@chmp thanks for taking your time and digging into it
pytest-xdist
is a plugin for pytest allowing to run tests in parallel.I installed it via pip but I can't get it to run in combination with IPytest. I allways get
ExitCode.NO_TESTS_COLLECTED: 5
I tried so far creating a ipynb notebook with the following cells:
Setup
Test 1: plain ipytest → works ✅
Test 2: ipytest + pytest-xdist → no tests are executed 🛑
What am I doing wrong?