]> granicus.if.org Git - python/commitdiff
Issue #18258: Fix test discovery for test_codecmaps_*.
authorZachary Ware <zachary.ware@gmail.com>
Wed, 2 Jul 2014 00:55:04 +0000 (19:55 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 2 Jul 2014 00:55:04 +0000 (19:55 -0500)
Lib/test/multibytecodec_support.py
Lib/test/test_codecmaps_cn.py
Lib/test/test_codecmaps_hk.py
Lib/test/test_codecmaps_jp.py
Lib/test/test_codecmaps_kr.py
Lib/test/test_codecmaps_tw.py

index 51ca3bd64f9ad60e382b39aead9e709d286f4fb3..51f5b541b3ef42ad108702bc8f67a974fcff94f7 100644 (file)
@@ -277,8 +277,7 @@ class TestBase_Mapping(unittest.TestCase):
     supmaps = []
     codectests = []
 
-    def __init__(self, *args, **kw):
-        unittest.TestCase.__init__(self, *args, **kw)
+    def setUp(self):
         try:
             self.open_mapping_file().close() # test it to report the error early
         except (OSError, HTTPException):
index 76632a24352e34c1738bf0d0c9a2eded0db775ea..8b84c14cc545d3a635d0f15c0b367530bea2b436 100644 (file)
@@ -25,8 +25,5 @@ class TestGB18030Map(multibytecodec_support.TestBase_Mapping,
                  'trunk/charset/data/xml/gb-18030-2000.xml'
 
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
index 9570af296c701b4bd31786281212c2fa9f3dffe3..12aada1968322a5e6bc3b6253da8a2235690c5ae 100644 (file)
@@ -12,8 +12,5 @@ class TestBig5HKSCSMap(multibytecodec_support.TestBase_Mapping,
     encoding = 'big5hkscs'
     mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS-2004.TXT'
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
index fa93f12f5a36f86a79c82ff271b673ad65b7ee12..1c66d80f079a021b6887d4f979ec25a291f8d543 100644 (file)
@@ -59,8 +59,5 @@ class TestSJISX0213Map(multibytecodec_support.TestBase_Mapping,
     mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT'
 
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
index e0bf71699488efa59263f261ce2308d6e397a134..404d74edf3d638cc4d191e1c6485444a2514ae32 100644 (file)
@@ -36,8 +36,5 @@ class TestJOHABMap(multibytecodec_support.TestBase_Mapping,
     pass_enctest = [(b'\\', '\u20a9')]
     pass_dectest = [(b'\\', '\u20a9')]
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
index 4d270804f09d6016634031c8de1e64ee15609c2f..9bf8340fb18b44c556b0a82dfaf4493feba7c5fd 100644 (file)
@@ -26,8 +26,5 @@ class TestCP950Map(multibytecodec_support.TestBase_Mapping,
         (b"\xFFxy", "replace",  "\ufffdxy"),
     )
 
-def test_main():
-    support.run_unittest(__name__)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()