How to access test result or test status in teardown in fixture in pytest..
Am trying to access test status in teardown/ finalization method in fixture in pytest with out using yield.
can someone please help with this ?
@pytest.fixture def json_loader(request): def _loader(filename): if(tes.success): # code need to be placed here in the if condition. print(‘filename’ + filename) request.addfinalizer(_loader)
def test_wrong_stop1(json_loader1): print(‘test’) assert 1 == 0