eugeniy / pytest-tornado

A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications.
Apache License 2.0
121 stars 34 forks source link

Fix the problem that subprocess can not run in gen_test mark #29

Closed yen3 closed 6 years ago

yen3 commented 6 years ago

pytest-tornado is very convenient to write coroutine test with @pytest.mark.gen_test. But I meet some problem. When I call Subprocess in @pytest.mark.gen_test. The first call is success. The second call would be fail. I look tornado source code (https://github.com/tornadoweb/tornado/blob/6682d58bf261bcaa0d0939e4fd50a496f10a32ec/tornado/testing.py#L218) and try to add tornado.process.Subprocess.uninitialize() to resolve the problem. I don't know what is the real root cause for the problem. But the patch works for me. If the patch does not resolve the problem what I mention. Please feel free to reject the pull request.