When using the only_rerun and rerun_except queries (or both), the plug-in was removing the teardown operations from the call-stack before checking to see if the test should be re-run. This resulted in the stack having all fixture operations removed that did not correspond to a function fixture.
This commmit adds a private variable to each test item that keeps track of whether a test encountered a terminal error. The plugin now checks if a test has encountered a terminal error before attempting to clear the stack.
When using the only_rerun and rerun_except queries (or both), the plug-in was removing the teardown operations from the call-stack before checking to see if the test should be re-run. This resulted in the stack having all fixture operations removed that did not correspond to a function fixture.
This commmit adds a private variable to each test item that keeps track of whether a test encountered a terminal error. The plugin now checks if a test has encountered a terminal error before attempting to clear the stack.
This commit fixes:
241: https://github.com/pytest-dev/pytest-rerunfailures/issues/241
234: https://github.com/pytest-dev/pytest-rerunfailures/issues/234