You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've encountered a situation with my test suite where the tests are interdependent, meaning the outcome of one test can affect subsequent tests. I understand that it's typically best practice to isolate tests, but due to the nature of my test suite, isolating each test is not feasible.
When I use the pytest-rerunfailures plugin, it only reruns the specific test that fails. In my case, however, if one test fails, I need all tests to be rerun because the failed test could influence the outcomes of the others.
Therefore, I'd like to propose a new feature or option for the plugin: an option to rerun the entire test suite (or a specified group of tests) if any test fails.
For now, my solution to solve this issue is this:
max_retries = 5
retries = 0
while retries < max_retries:
result = pytest.main(["tests/test_my_tests.py"])
if result == 0:
print("Tests passed!")
break
else:
print("Tests failed, rerunning...")
retries += 1
This feature would provide value for test suites where tests are interdependent and the failure of one test may invalidate the outcomes of the others. I believe this could be a useful addition to the plugin's functionality.
Thank you for considering my proposal.
The text was updated successfully, but these errors were encountered:
Hi,
I've encountered a situation with my test suite where the tests are interdependent, meaning the outcome of one test can affect subsequent tests. I understand that it's typically best practice to isolate tests, but due to the nature of my test suite, isolating each test is not feasible.
When I use the pytest-rerunfailures plugin, it only reruns the specific test that fails. In my case, however, if one test fails, I need all tests to be rerun because the failed test could influence the outcomes of the others.
Therefore, I'd like to propose a new feature or option for the plugin: an option to rerun the entire test suite (or a specified group of tests) if any test fails.
For now, my solution to solve this issue is this:
This feature would provide value for test suites where tests are interdependent and the failure of one test may invalidate the outcomes of the others. I believe this could be a useful addition to the plugin's functionality.
Thank you for considering my proposal.
The text was updated successfully, but these errors were encountered: