Replies: 2 comments 1 reply
-
I'd say this is expected - after a |
Beta Was this translation helpful? Give feedback.
1 reply
-
I tried another unsuccessful approach. Teardown of fixture one gets called before hook call. import pytest
@pytest.fixture(scope="function")
def two():
yield
raise AssertionError
@pytest.fixture(scope="function")
def one():
yield
pass
def test_fixtures(one, two):
pass conftest.py import pytest
@pytest.hookimpl()
def pytest_exception_interact(node, call, report):
if call.when == 'teardown' and report.failed:
# do something here when an exception is raised at fixture teardown
pass |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to know if test failed at teardown and pass that information to next fixture in teardown process. I've been looking into this example, but problem is that
rep_teardown
never exists. https://docs.pytest.org/en/7.1.x/example/simple.html#making-test-result-information-available-in-fixturesI can find rep_setup and rep_call but no rep_teardown

test.py
conftest.py
Beta Was this translation helpful? Give feedback.
All reactions