summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-09-11 09:50:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-09-11 09:50:02 (GMT)
commitbd48d27944453ad83d3ce37b2c867fa0d59a1c15 (patch)
treef5585b5ce3995541ed6cce7bb4daef97f936be89 /Lib/test/test_re.py
parent352601ca00376aaf07d4399096f985d3d8ecb96f (diff)
downloadcpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.zip
cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.tar.gz
cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.tar.bz2
Issue #22493: Inline flags now should be used only at the start of the
regular expression. Deprecation warning is emitted if uses them in the middle of the regular expression.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index afe8738..79a7a05 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1279,6 +1279,9 @@ class ReTests(unittest.TestCase):
self.assertTrue(re.match('(?ixu) ' + upper_char, lower_char))
self.assertTrue(re.match('(?ixu) ' + lower_char, upper_char))
+ with self.assertWarns(DeprecationWarning):
+ self.assertTrue(re.match(upper_char + '(?i)', lower_char))
+
def test_dollar_matches_twice(self):
"$ matches the end of string, and just before the terminating \n"
pattern = re.compile('$')