[Python-checkins] cpython (merge 2.7 -> 2.7): merge heads

senthil.kumaran python-checkins at python.org
Tue Mar 13 08:17:29 CET 2012


http://hg.python.org/cpython/rev/755a5f18ccf3
changeset:   75577:755a5f18ccf3
branch:      2.7
parent:      75576:f3c8bdbe2cf3
parent:      75563:cc48eef234dd
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Tue Mar 13 00:15:15 2012 -0700
summary:
  merge heads

files:
  Lib/test/test_re.py |  10 ++++++++++
  Misc/ACKS           |   1 +
  2 files changed, 11 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
@@ -783,6 +783,16 @@
         self.assertRaises(TypeError, re.finditer, "a", {})
         self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
 
+    def test_compile(self):
+        # Test return value when given string and pattern as parameter
+        pattern = re.compile('random pattern')
+        self.assertIsInstance(pattern, re._pattern_type)
+        same_pattern = re.compile(pattern)
+        self.assertIsInstance(same_pattern, re._pattern_type)
+        self.assertIs(same_pattern, pattern)
+        # Test behaviour when not given a string or pattern as parameter
+        self.assertRaises(TypeError, re.compile, 0)
+
 def run_re_tests():
     from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
     if verbose:
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -577,6 +577,7 @@
 Andrii V. Mishkovskyi
 Dustin J. Mitchell
 Dom Mitchell
+Florian Mladitsch
 Doug Moen
 The Dragon De Monsyne
 Skip Montanaro

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


More information about the Python-checkins mailing list