When running with -O or -OO options assert are dismissed, so the line which call regular expression to test the email is not executed.
In place of
assert re.match(VALID_ADDRESS_REGEXP, email) is not None
You should write
if re.match(VALID_ADDRESS_REGEXP, email) is None:
return False
(or raise an exception if you prefer)
A+
L.Pointal
When running with -O or -OO options
assertare dismissed, so the line which call regular expression to test the email is not executed.In place of
You should write
(or raise an exception if you prefer)
A+
L.Pointal