File tree 3 files changed +8
-5
lines changed
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
language : python
2
- python : 2.7
3
2
4
3
sudo : required
5
4
Original file line number Diff line number Diff line change 1
1
import unittest
2
- import urllib2
3
2
import time
4
3
import json
5
4
5
+ try :
6
+ from urllib2 import urlopen
7
+ except ImportError :
8
+ from urllib .request import urlopen
9
+
6
10
7
11
class SmokeTests (unittest .TestCase ):
8
12
def smoke_test_container (self , port ):
@@ -15,7 +19,7 @@ def smoke_test_container(self, port):
15
19
while current_attempts < max_attempts :
16
20
current_attempts = current_attempts + 1
17
21
try :
18
- response = urllib2 . urlopen ('http://localhost:%s/wd/hub/status' % port )
22
+ response = urlopen ('http://localhost:%s/wd/hub/status' % port )
19
23
status_json = json .loads (response .read ())
20
24
self .assertTrue (status_json ['value' ]['ready' ], "Container is not ready on port %s" % port )
21
25
status_fetched = True
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ def launch_container(container, **kwargs):
161
161
test_runner = unittest .TextTestRunner (verbosity = 3 )
162
162
failed = not test_runner .run (suite ).wasSuccessful ()
163
163
except Exception as e :
164
- logger .fatal (e . message )
164
+ logger .fatal (e )
165
165
failed = True
166
166
167
167
try :
@@ -172,7 +172,7 @@ def launch_container(container, **kwargs):
172
172
test_runner = unittest .TextTestRunner (verbosity = 3 )
173
173
failed = not test_runner .run (suite ).wasSuccessful ()
174
174
except Exception as e :
175
- logger .fatal (e . message )
175
+ logger .fatal (e )
176
176
failed = True
177
177
178
178
logger .info ("Cleaning up..." )
You can’t perform that action at this time.
0 commit comments