Skip to content

bpo-29887: Test normalization now fails if download fails #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Lib/test/test_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,20 @@ def unistr(data):

class NormalizationTest(unittest.TestCase):
def test_main(self):
part = None
part1_data = {}
# Hit the exception early
try:
testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
check=check_version)
except (OSError, HTTPException):
self.skipTest("Could not retrieve " + TESTDATAURL)
self.addCleanup(testdata.close)
self.fail(f"Could not retrieve {TESTDATAURL}")

with testdata:
self.run_normalization_tests(testdata)

def run_normalization_tests(self, testdata):
part = None
part1_data = {}

for line in testdata:
if '#' in line:
line = line.split('#')[0]
Expand Down