Skip to content

Commit

Permalink
Improve tests.
Browse files Browse the repository at this point in the history
Now that jigna Python3 bug is fixed, run the integration tests on
Python3 also.
  • Loading branch information
prabhuramachandran committed Mar 23, 2017
1 parent 203ccfd commit a80619d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ before_script:
script:
- coverage erase
- coverage run -p -m nose.core -v vixen/tests
- if [[ ${TRAVIS_PYTHON_VERSION} == "2.7" ]] ; then coverage run -p -m nose.core -v vixen/integration_tests; fi
- coverage run -p -m nose.core -v vixen/integration_tests
- coverage combine

after_success:
Expand Down
20 changes: 16 additions & 4 deletions vixen/integration_tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
from vixen.tests.test_directory import make_data


def start_io_loop():
ioloop = IOLoop.instance()
ioloop.make_current()
ioloop.start()


def stop_io_loop():
IOLoop.instance().stop()


class TestUI(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand All @@ -27,8 +37,7 @@ def setUpClass(cls):
ui = make_ui()
port = 9876
main(dev=True, port=port, test=True, **ui.get_context())
ioloop = IOLoop.instance()
t = Thread(target=ioloop.start)
t = Thread(target=start_io_loop)
t.setDaemon(True)
t.start()

Expand All @@ -50,8 +59,11 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
cls.browser.quit()
IOLoop.instance().stop()
time.sleep(1)
IOLoop.instance().add_callback(stop_io_loop)
thread = cls.thread
count = 0
while thread.is_alive() and count < 50:
time.sleep(0.1)
cls.thread.join()
del os.environ['VIXEN_ROOT']
shutil.rmtree(cls.root)
Expand Down

0 comments on commit a80619d

Please sign in to comment.