Closed Jonas1312 closed 1 year ago
If you want to match part of the error string why not just prefix (and/or suffix) .*
to your pattern string?
I think the change you are proposing would make it impossible to strictly match the full exact error string, which seems undesirable.
I see, your solution works, thanks
I was confused because the behavior is different to the pytest.raises(match="...")
Hi,
https://github.com/jd/tenacity/blob/310058274ed22a345e9c3917c97b4afd6363d5a5/tenacity/retry.py#L220
re.match(pattern, str)
Matches pattern only at the beginning of the string.Expected behavior: it should match the pattern anywhere in the string
Proposed fix: use
re.search(pattern, str)
Thanks!