diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-31 22:01:03 +0000 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-31 22:01:03 +0000 |
commit | 6257a7bbb2660ae75c44f2e71d7ac2ce73900f74 (patch) | |
tree | 6f010065c95f2d5617f56e07ba2628be21cf9d7a /Lib/test/test_re.py | |
parent | ad5983364966b49c277b495112ae41c6ae2d01ed (diff) | |
download | cpython-git-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.tar.gz |
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index ba2f521a6f..f978086dbc 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1,4 +1,4 @@ -from test.test_support import verbose, run_unittest +from test.test_support import verbose, run_unittest, import_module import re from re import Scanner import sys, traceback @@ -447,11 +447,8 @@ class ReTests(unittest.TestCase): import cPickle self.pickle_test(cPickle) # old pickles expect the _compile() reconstructor in sre module - import warnings - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", "The sre module is deprecated", - DeprecationWarning) - from sre import _compile + import_module("sre", deprecated=True) + from sre import _compile def pickle_test(self, pickle): oldpat = re.compile('a(?:b|(c|e){1,2}?|d)+?(.)') |