summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_multibytecodec_support.py
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2005-12-10 17:44:27 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2005-12-10 17:44:27 (GMT)
commitaaa2f1dea706daf2a5f431d97a3e3120dba652d2 (patch)
treec602cfc7ed52919ab7cffa175abfe4a6880869ac /Lib/test/test_multibytecodec_support.py
parent432be36056ca12f5265616f07d2f369d5878982d (diff)
downloadcpython-aaa2f1dea706daf2a5f431d97a3e3120dba652d2.zip
cpython-aaa2f1dea706daf2a5f431d97a3e3120dba652d2.tar.gz
cpython-aaa2f1dea706daf2a5f431d97a3e3120dba652d2.tar.bz2
Patch #1276356: Implement new resource "urlfetch" for regrtest.
This enables even impatient people to run tests that require remote files such as test_normalization and test_codecmaps_*.
Diffstat (limited to 'Lib/test/test_multibytecodec_support.py')
-rw-r--r--Lib/test/test_multibytecodec_support.py22
1 files changed, 5 insertions, 17 deletions
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py
index 22b52f7..45a63e7 100644
--- a/Lib/test/test_multibytecodec_support.py
+++ b/Lib/test/test_multibytecodec_support.py
@@ -163,15 +163,16 @@ class TestBase_Mapping(unittest.TestCase):
def __init__(self, *args, **kw):
unittest.TestCase.__init__(self, *args, **kw)
- if not os.path.exists(self.mapfilename):
- raise test_support.TestSkipped('%s not found, download from %s' %
- (self.mapfilename, self.mapfileurl))
+ self.open_mapping_file() # test it to report the error early
+
+ def open_mapping_file(self):
+ return test_support.open_urlresource(self.mapfileurl)
def test_mapping_file(self):
unichrs = lambda s: u''.join(map(unichr, map(eval, s.split('+'))))
urt_wa = {}
- for line in open(self.mapfilename):
+ for line in self.open_mapping_file():
if not line:
break
data = line.split('#')[0].strip().split()
@@ -217,16 +218,3 @@ def load_teststring(encoding):
else:
from test import cjkencodings_test
return cjkencodings_test.teststring[encoding]
-
-def register_skip_expected(*cases):
- for case in cases: # len(cases) must be 1 at least.
- for path in [os.path.curdir, os.path.pardir]:
- fn = os.path.join(path, case.mapfilename)
- if os.path.exists(fn):
- case.mapfilename = fn
- break
- else:
- sys.modules[case.__module__].skip_expected = True
- break
- else:
- sys.modules[case.__module__].skip_expected = False