From 5ca6f6c755bb8b3d3a3190bab4cf6f0a1eb6b2a7 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 27 Mar 2013 17:40:39 -0400 Subject: [PATCH] Skip test_readme_5() if web query fails. --- tests/test_docs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_docs.py b/tests/test_docs.py index 075b0a7..971c5d1 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -113,7 +113,10 @@ class TestDocs(unittest.TestCase): title = "Test" data = {"action": "query", "prop": "revisions", "rvlimit": 1, "rvprop": "content", "format": "json", "titles": title} - raw = urllib.urlopen(url1, urllib.urlencode(data)).read() + try: + raw = urllib.urlopen(url1, urllib.urlencode(data)).read() + except IOError: + self.skipTest("cannot continue because of unsuccessful web call") res = json.loads(raw) text = res["query"]["pages"].values()[0]["revisions"][0]["*"] expected = urllib.urlopen(url2.format(title)).read().decode("utf8")