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 am using hypothesis for testing a python library that runs C code under the hood. Sometimes, the test crashes (e.g. with a segfault) and it is a pain to debug: I don't have the nice error output from hypothesis since the program terminated abruptly.
It would greatly help me to at least be able to reproduce the failure outside my test base, with a simple example. So, I thought about logging each test along with its parameters before the test is actually called. Is there an easy way to do that with hypothesis? I can always manually annotate all my tests, but that would be tedious.
The text was updated successfully, but these errors were encountered:
You can use .hypothesis.inner_test to apply a decorator "inside" @given() after the fact, which with Pytest hooks is a rather convenient way to add logging (or whatever other pre- and post-hooks you want) to all your tests.
Although note that you could instead use this to run the actual code-under-test in a freshly forked process each time, which would give you nice shrinking and so on as well by preventing it from tearing down the host process!
Hello,
I am using hypothesis for testing a python library that runs C code under the hood. Sometimes, the test crashes (e.g. with a segfault) and it is a pain to debug: I don't have the nice error output from hypothesis since the program terminated abruptly.
It would greatly help me to at least be able to reproduce the failure outside my test base, with a simple example. So, I thought about logging each test along with its parameters before the test is actually called. Is there an easy way to do that with hypothesis? I can always manually annotate all my tests, but that would be tedious.
The text was updated successfully, but these errors were encountered: