In my project, I use @pytest.mark.flaky(reruns=3, rerun_except=CustomException) using a specific custom Exception on a couple of tests. That causes the following error that looks similar to issue #175:
INTERNALERROR> E File "/Users/matheuspessoa/PycharmProjects/bigcommerce-adapter/venv/lib/python3.10/site-packages/pytest_rerunfailures.py", line 331, in _matches_any_rerun_except_error
INTERNALERROR> E if re.search(rerun_regex, report.longrepr.reprcrash.message):
INTERNALERROR> E AttributeError: 'str' object has no attribute 'reprcrash'
INTERNALERROR> E assert False
So I suggest the same fix, which I tested locally and worked.
for rerun_regex in rerun_except_errors:
try:
if re.search(rerun_regex, report.longrepr.reprcrash.message):
return True
except AttributeError:
if re.search(rerun_regex, report.longreprtext):
return True
return False```python
Hello!
In my project, I use @pytest.mark.flaky(reruns=3, rerun_except=CustomException) using a specific custom Exception on a couple of tests. That causes the following error that looks similar to issue #175:
So I suggest the same fix, which I tested locally and worked.