Browse Source

merge heads

pull/2332/head
Senthil Kumaran 15 years ago
parent
commit
b968b36ad0
  1. 10
      Lib/test/test_re.py
  2. 1
      Misc/ACKS

10
Lib/test/test_re.py

@ -783,6 +783,16 @@ class ReTests(unittest.TestCase):
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:

1
Misc/ACKS

@ -577,6 +577,7 @@ Roman Milner
Andrii V. Mishkovskyi
Dustin J. Mitchell
Dom Mitchell
Florian Mladitsch
Doug Moen
The Dragon De Monsyne
Skip Montanaro

Loading…
Cancel
Save