pytest-dev / pytest-forked

extracted --boxed from pytest-xdist to ensure backward compat
MIT License
65 stars 21 forks source link

Windows support #5

Closed letmaik closed 7 years ago

letmaik commented 7 years ago

Great plugin! What would be required to add Windows support? Did anyone try it yet and has some insight on the obstacles?

RonnyPfannschmidt commented 7 years ago

windows has no fork support - so it can never be supported

WillDaSilva commented 2 years ago

Would it be possible to use multiprocessing.get_context('spawn').Process(...) instead of forking? This would require passing the test node to the spawned process. I can see that Pytest nodes are not currently serializable with Pickle, but I'm not sure how difficult it would be to make them serializable.

I have a working proof of concept that uses multiprocessing with the 'fork' context instead of py.process.ForkedFunc. If passing test nodes into a spawned process is possible, it would be a big win.

nicoddemus commented 2 years ago

I can see that Pytest nodes are not currently serializable with Pickle, but I'm not sure how difficult it would be to make them serializable.

Unfortunately very difficult ("impossible" is a harsh word but pretty close!).

Besides the pytest.Node itself, there's also the problem of transferring the fixtures used by a test to the spawned process (with forking you don't have the problem because the memory is copied of course).