Issue #28082: Add basic unit tests on re enums

This commit is contained in:
Victor Stinner 2016-11-14 12:38:43 +01:00
parent fb6a6596b5
commit 8bf43e6d0b
1 changed files with 6 additions and 0 deletions

View File

@ -1771,6 +1771,12 @@ SUBPATTERN None 0 0
self.checkPatternError(r'(?<>)', 'unknown extension ?<>', 1)
self.checkPatternError(r'(?', 'unexpected end of pattern', 2)
def test_enum(self):
# Issue #28082: Check that str(flag) returns a human readable string
# instead of an integer
self.assertIn('ASCII', str(re.A))
self.assertIn('DOTALL', str(re.S))
class PatternReprTests(unittest.TestCase):
def check(self, pattern, expected):