Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stateful testing: steps not printed on pytest.fail() #1372

Closed
Zac-HD opened this issue Jun 30, 2018 · 0 comments · Fixed by #1373
Closed

Stateful testing: steps not printed on pytest.fail() #1372

Zac-HD opened this issue Jun 30, 2018 · 0 comments · Fixed by #1373
Labels
bug something is clearly wrong here

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Jun 30, 2018

Via a longer case posted on stackoverflow, I found out that BaseException - or subclasses like pytest.Failed - skips the printing of the steps taken to produce the error.

from hypothesis.stateful import RuleBasedStateMachine, rule

class RaisesProblem(RuleBasedStateMachine):

    @rule()
    def oops(self):
        raise BaseException('The steps should be printed too!')

Test = RaisesProblem.TestCase

Suggested resolution: there is probably somewhere which catches Exception but should catch BaseException (perhaps re-raising HypothesisBaseException). Finding and fixing that might be enough, along with a regression test of course!

@Zac-HD Zac-HD added the bug something is clearly wrong here label Jun 30, 2018
@Zac-HD Zac-HD changed the title Stateful testing: steps not printed if BaseException is raised Stateful testing: steps not printed on pytest.fail() Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant