summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2014-07-02 00:55:04 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2014-07-02 00:55:04 (GMT)
commitd9de794c232078c1c024aa117e16e7367dafce13 (patch)
tree81306a6145cea48c3d345b03967c070194e4a361 /Lib
parent44f09ebd0f9914db8ad20d54a1d1f07164b95a1f (diff)
downloadcpython-d9de794c232078c1c024aa117e16e7367dafce13.zip
cpython-d9de794c232078c1c024aa117e16e7367dafce13.tar.gz
cpython-d9de794c232078c1c024aa117e16e7367dafce13.tar.bz2
Issue #18258: Fix test discovery for test_codecmaps_*.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/multibytecodec_support.py3
-rw-r--r--Lib/test/test_codecmaps_cn.py5
-rw-r--r--Lib/test/test_codecmaps_hk.py5
-rw-r--r--Lib/test/test_codecmaps_jp.py5
-rw-r--r--Lib/test/test_codecmaps_kr.py5
-rw-r--r--Lib/test/test_codecmaps_tw.py5
6 files changed, 6 insertions, 22 deletions
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
index 51ca3bd..51f5b54 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -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):
diff --git a/Lib/test/test_codecmaps_cn.py b/Lib/test/test_codecmaps_cn.py
index 76632a2..8b84c14 100644
--- a/Lib/test/test_codecmaps_cn.py
+++ b/Lib/test/test_codecmaps_cn.py
@@ -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()
diff --git a/Lib/test/test_codecmaps_hk.py b/Lib/test/test_codecmaps_hk.py
index 9570af2..12aada1 100644
--- a/Lib/test/test_codecmaps_hk.py
+++ b/Lib/test/test_codecmaps_hk.py
@@ -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()
diff --git a/Lib/test/test_codecmaps_jp.py b/Lib/test/test_codecmaps_jp.py
index fa93f12..1c66d80 100644
--- a/Lib/test/test_codecmaps_jp.py
+++ b/Lib/test/test_codecmaps_jp.py
@@ -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()
diff --git a/Lib/test/test_codecmaps_kr.py b/Lib/test/test_codecmaps_kr.py
index e0bf716..404d74e 100644
--- a/Lib/test/test_codecmaps_kr.py
+++ b/Lib/test/test_codecmaps_kr.py
@@ -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()
diff --git a/Lib/test/test_codecmaps_tw.py b/Lib/test/test_codecmaps_tw.py
index 4d27080..9bf8340 100644
--- a/Lib/test/test_codecmaps_tw.py
+++ b/Lib/test/test_codecmaps_tw.py
@@ -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()