forked from TrueCloudLab/frostfs-testlib
11 lines
308 B
Python
11 lines
308 B
Python
import re
|
|
|
|
|
|
def error_matches_status(error: Exception, status_pattern: str) -> bool:
|
|
"""
|
|
Determines whether exception matches specified status pattern.
|
|
|
|
We use re.search() to be consistent with pytest.raises.
|
|
"""
|
|
match = re.search(status_pattern, str(error))
|
|
return match is not None
|