| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Interesting, have you tested the --pdb behaviour?
Sorry, something went wrong.
|
|
||
| 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
Sorry, something went wrong.
There was a problem hiding this comment.
good idea, updated!
Sorry, something went wrong.
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 pytest --pdb --timeout 1. It enters the debugger on assert False and cancels the timeout (it doesn't trigger if you sit in the debugger for a few seconds, and it doesn't trigger in bad_fixture afterward if you use the continue command). |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
Looks like it's pytest>=8.0.0 for the upcoming release. I tested with pytest==8.0.0 as well just to make sure; everything seems fine! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Removes the hook so that fixture teardowns can time out after a failed test. See issue #196 for details!
The pytest_enter_pdb hook 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.