remove pytest_exception_interact hook#197
Conversation
flub
left a comment
There was a problem hiding this comment.
Interesting, have you tested the --pdb behaviour?
|
|
||
| def test_foo(self, fix): | ||
| pass | ||
| {"assert False" if fail else "pass"} |
There was a problem hiding this comment.
can assert {fail} or something close to it work? seems slightly simpler
There was a problem hiding this comment.
good idea, updated!
Yes, tried that out as well. I used this script: import time
import pytest
@pytest.fixture
def bad_fixture():
yield
time.sleep(5)
def test_timeout(bad_fixture):
assert FalseAnd ran it with |
|
I assume this breaks compatibility with some older versions of pytest. But we already require pytest >= 7.0 which was from 2022 it seems. Which is way older than 2014 when the newer hook was added. |
|
Looks like it's |
Removes the hook so that fixture teardowns can time out after a failed test. See issue #196 for details!
The
pytest_enter_pdbhook handles debugger interactions, so I believe the original purpose of this hook is covered. I can't think of any other reason someone might find this behavior useful.