[Python-checkins] cpython (3.6): Issue #28082: Add basic unit tests on re enums

victor.stinner python-checkins at python.org
Mon Nov 14 06:40:58 EST 2016


https://hg.python.org/cpython/rev/be66786e95de
changeset:   105103:be66786e95de
branch:      3.6
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Nov 14 12:38:43 2016 +0100
summary:
  Issue #28082: Add basic unit tests on re enums

files:
  Lib/test/test_re.py |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1771,6 +1771,12 @@
         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):

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list