Would it not be useful to have an assertRegexMatch(string, pattern) method on TestCase?
The standard library already provides assertRegex
and assertNotRegex
: https://docs.python.org/3.8/library/unittest.html#unittest.TestCase.assertRegex
This is based on re.search
; to check like re.match
, start the pattern with ^
.
Thanks! And apologies also, I thought I had checked python’s unittest assertions.