mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
test_normalization should skip and not crash when the resource isn't available
This commit is contained in:
parent
373469a251
commit
8844153d7f
1 changed files with 5 additions and 2 deletions
|
@ -40,6 +40,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)
|
||||||
|
except IOError:
|
||||||
|
self.skipTest("Could not retrieve " + TESTDATAURL)
|
||||||
for line in open_urlresource(TESTDATAURL):
|
for line in open_urlresource(TESTDATAURL):
|
||||||
if '#' in line:
|
if '#' in line:
|
||||||
line = line.split('#')[0]
|
line = line.split('#')[0]
|
||||||
|
@ -95,8 +100,6 @@ class NormalizationTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
# Hit the exception early
|
|
||||||
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