mirror of
https://github.com/python/cpython.git
synced 2025-10-13 18:33:34 +00:00
Merged revisions 76033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76033 | antoine.pitrou | 2009-11-01 22:26:14 +0100 (dim., 01 nov. 2009) | 3 lines test_normalization should skip and not crash when the resource isn't available ........
This commit is contained in:
parent
e0450c6aae
commit
7e05e7d3b6
1 changed files with 5 additions and 2 deletions
|
@ -42,6 +42,11 @@ def unistr(data):
|
||||||
class NormalizationTest(unittest.TestCase):
|
class NormalizationTest(unittest.TestCase):
|
||||||
def test_main(self):
|
def test_main(self):
|
||||||
part1_data = {}
|
part1_data = {}
|
||||||
|
# Hit the exception early
|
||||||
|
try:
|
||||||
|
open_urlresource(TESTDATAURL, encoding="utf-8")
|
||||||
|
except IOError:
|
||||||
|
self.skipTest("Could not retrieve " + TESTDATAURL)
|
||||||
for line in open_urlresource(TESTDATAURL, encoding="utf-8"):
|
for line in open_urlresource(TESTDATAURL, encoding="utf-8"):
|
||||||
if '#' in line:
|
if '#' in line:
|
||||||
line = line.split('#')[0]
|
line = line.split('#')[0]
|
||||||
|
@ -97,8 +102,6 @@ class NormalizationTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
# Skip the test early if the 'urlfetch' resource is not enabled.
|
|
||||||
open_urlresource(TESTDATAURL)
|
|
||||||
run_unittest(NormalizationTest)
|
run_unittest(NormalizationTest)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue