]> granicus.if.org Git - python/commitdiff
test_invalid_sequences seems don't have to stay in CAPITest.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 2 Oct 2016 18:59:44 +0000 (21:59 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 2 Oct 2016 18:59:44 +0000 (21:59 +0300)
Reported by Xiang Zhang.

Lib/test/test_unicode.py

index c98cc14024247685056c0e48b486855fa1f26443..432a001e7cb0adac5ae41326da66f772da98b4fc 100644 (file)
@@ -2413,6 +2413,13 @@ class UnicodeTest(string_tests.CommonTest,
         support.check_free_after_iterating(self, iter, str)
         support.check_free_after_iterating(self, reversed, str)
 
+    def test_invalid_sequences(self):
+        for letter in string.ascii_letters + "89": # 0-7 are octal escapes
+            if letter in "abfnrtuvxNU":
+                continue
+            with self.assertWarns(DeprecationWarning):
+                eval(r"'\%s'" % letter)
+
 
 class CAPITest(unittest.TestCase):
 
@@ -2773,13 +2780,6 @@ class CAPITest(unittest.TestCase):
                 # Check that the second call returns the same result
                 self.assertEqual(getargs_s_hash(s), chr(k).encode() * (i + 1))
 
-    def test_invalid_sequences(self):
-        for letter in string.ascii_letters + "89": # 0-7 are octal escapes
-            if letter in "abfnrtuvxNU":
-                continue
-            with self.assertWarns(DeprecationWarning):
-                eval(r"'\%s'" % letter)
-
 class StringModuleTest(unittest.TestCase):
     def test_formatter_parser(self):
         def parse(format):