##// END OF EJS Templates
Use requests throughout test_pr
Thomas Kluyver -
Show More
@@ -16,10 +16,6 b' import re'
16 16 import requests
17 17 import shutil
18 18 from subprocess import call, check_call, check_output, PIPE, STDOUT, CalledProcessError
19 try:
20 from urllib.request import urlopen
21 except ImportError:
22 from urllib2 import urlopen
23 19
24 20 import gh_auth
25 21
@@ -72,8 +68,7 b' def setup():'
72 68
73 69 def get_pull_request(num):
74 70 url = "https://api.github.com/repos/{project}/pulls/{num}".format(project=gh_project, num=num)
75 response = urlopen(url).read().decode('utf-8')
76 return json.loads(response)
71 return json.loads(requests.get(url).text)
77 72
78 73 missing_libs_re = re.compile(r"Tools and libraries NOT available at test time:\n"
79 74 r"\s*(.*?)\n")
@@ -125,8 +120,8 b' def post_gist(content, description=\'IPython test log\', filename="results.log"):'
125 120 }
126 121 }).encode('utf-8')
127 122
128 response = urlopen("https://api.github.com/gists", post_data)
129 response_data = json.loads(response.read().decode('utf-8'))
123 response = requests.post("https://api.github.com/gists", data=post_data)
124 response_data = json.loads(response.text)
130 125 return response_data['html_url']
131 126
132 127 def markdown_format(pr, results):
General Comments 0
You need to be logged in to leave comments. Login now