-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Right now the pytest plugin is (roughly)
@pytest.hookimpl(tryfirst=True)
def pytest_pyfunc_call(pyfuncitem):
if not plugin_enabled:
return # don't do anything youreslf
else:
passing = False
while not passing:
test_call_result = call_test(pyfuncitem)
passing = test_call_result.succeeded
if not passing:
enter_pdb(test_call_result)
return
So you try running the test, and if it fails you fall into pdb and then run it again.
This will execute setup and teardown for some stuff but it won't do things like fixture resetting for those that require it. In particular for stuff like pytest-django's db marker, you end up not rollbacking the commit, so on subsequent runs things don't work well.
What likely needs to go on here is that we need to emulate fixture teardown and setup on failures (though trying to be smart about it....somehow). I think that only resetting function-scoped fixtures should do the job
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels