]> granicus.if.org Git - python/commitdiff
Issue #28082: Add basic unit tests on re enums
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 14 Nov 2016 11:38:43 +0000 (12:38 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 14 Nov 2016 11:38:43 +0000 (12:38 +0100)
Lib/test/test_re.py

index 3bd6d7b461cb042076bb29daf814c6deb0d65a9d..aac3a2cbab48c752d70a5cb3cb1849d8f9ec4305 100644 (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):