use six.moves for legacy import. fixed testing port number
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/df3bba52 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/df3bba52 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/df3bba52 Branch: refs/heads/TINKERPOP-1581 Commit: df3bba525b8cdd7f42aaf6508dfc575b9ad85e7a Parents: 4649c81 Author: davebshow <[email protected]> Authored: Fri Dec 9 17:32:45 2016 -0500 Committer: Stephen Mallette <[email protected]> Committed: Fri Dec 16 11:52:15 2016 -0500 ---------------------------------------------------------------------- .../driver/test_driver_remote_connection_threaded.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df3bba52/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py ---------------------------------------------------------------------- diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py index 756ef90..759126b 100644 --- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py +++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection_threaded.py @@ -1,9 +1,9 @@ import sys -from queue import Queue from threading import Thread import pytest +from six.moves import queue from tornado import ioloop from gremlin_python.driver.driver_remote_connection import ( @@ -13,7 +13,7 @@ from gremlin_python.structure.graph import Graph skip = False try: - connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g') + connection = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g') connection.close() except: skip = True @@ -23,7 +23,7 @@ except: class TestDriverRemoteConnectionThreaded: def test_threaded_client(self): - q = Queue() + q = queue.Queue() # Here if we give each thread its own loop there is no problem. loop1 = ioloop.IOLoop() loop2 = ioloop.IOLoop() @@ -38,7 +38,7 @@ class TestDriverRemoteConnectionThreaded: child2.join() def test_threaded_client_error(self): - q = Queue() + q = queue.Queue() # This scenario fails because both threads try to access the main # thread event loop - bad - each thread needs its own loop. # This is what happens when you can't manually set the loop. @@ -59,7 +59,7 @@ class TestDriverRemoteConnectionThreaded: def _executor(self, q, loop): try: connection = DriverRemoteConnection( - 'ws://localhost:8182/gremlin', 'g', loop=loop) + 'ws://localhost:45940/gremlin', 'g', loop=loop) g = Graph().traversal().withRemote(connection) assert len(g.V().toList()) == 6 except:
