You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project using pytest-twisted, and I'd like to write some tests using hypothesis' stateful testing. Since the control-flow of stateful testing is handled by hypothesis, I use pytest_twisted.blockon in the tests to interact with twisted.
However, this doesn't work by default, as pytest-twisted forces every test function to run in the reactor greenlet. There is a comment in the pytest_pyfunc_call hook suggesting this change:
Based on the comment it seems the tension is simply between moving forward to a sensible place where you explicitly request pytest-twisted handle's your tests and the desire to not break backwards compatibility... bah. Perhaps a sensible transitional tool would be an ability to explicitly mark a test to not be handled by pytest-twisted? Would you consider that a useful and reasonable middle ground to address this in the short term?
I'll go ahead and note that while I do have a little familiarity with hypothesis, I don't have any with their stateful testing. As such, my commentary here, at least for now, won't have any hope of offering any specific insight about what a good way to integrate that with pytest-twisted would be. Though, having to use pytest_twisted.blockon() strikes me as a thing that we would like to avoid as much as possible.
I have a project using pytest-twisted, and I'd like to write some tests using hypothesis' stateful testing. Since the control-flow of stateful testing is handled by hypothesis, I use
pytest_twisted.blockon
in the tests to interact with twisted.However, this doesn't work by default, as
pytest-twisted
forces every test function to run in the reactor greenlet. There is a comment in thepytest_pyfunc_call
hook suggesting this change:pytest-twisted/pytest_twisted.py
Lines 357 to 363 in cc03b11
This is perhaps a duplicate of #64.
The text was updated successfully, but these errors were encountered: