Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: python
python: 2.7

sudo: required

Expand Down
8 changes: 6 additions & 2 deletions tests/SmokeTests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import unittest
import urllib2
import time
import json

try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen


class SmokeTests(unittest.TestCase):
def smoke_test_container(self, port):
Expand All @@ -15,7 +19,7 @@ def smoke_test_container(self, port):
while current_attempts < max_attempts:
current_attempts = current_attempts + 1
try:
response = urllib2.urlopen('http://localhost:%s/wd/hub/status' % port)
response = urlopen('http://localhost:%s/wd/hub/status' % port)
status_json = json.loads(response.read())
self.assertTrue(status_json['value']['ready'], "Container is not ready on port %s" % port)
status_fetched = True
Expand Down
4 changes: 2 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def launch_container(container, **kwargs):
test_runner = unittest.TextTestRunner(verbosity=3)
failed = not test_runner.run(suite).wasSuccessful()
except Exception as e:
logger.fatal(e.message)
logger.fatal(e)
failed = True

try:
Expand All @@ -172,7 +172,7 @@ def launch_container(container, **kwargs):
test_runner = unittest.TextTestRunner(verbosity=3)
failed = not test_runner.run(suite).wasSuccessful()
except Exception as e:
logger.fatal(e.message)
logger.fatal(e)
failed = True

logger.info("Cleaning up...")
Expand Down