pytest-check
pytest-check copied to clipboard
Include a `check.match` and `check.not_match` for regex comparison
Should be straightforward as:
def match(regex, string, msg=""):
__tracebackhide__ = True
if regex.match(string):
return True
else:
log_failure(f"check {regex}.match({string})", msg)
return False
In the meantime check.is_true could also be used.
This might be cool. I'd consider a PR.