tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davebs...@apache.org
Subject [16/21] tinkerpop git commit: a couple small fixes in tests
Date Fri, 17 Feb 2017 16:42:59 GMT
a couple small fixes in tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/aa848c1a
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/aa848c1a
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/aa848c1a

Branch: refs/heads/TINKERPOP-1599
Commit: aa848c1add11e67cedebb6a63d2a9e40f1cb2072
Parents: 1d203b7
Author: davebshow <davebshow@gmail.com>
Authored: Mon Jan 30 20:02:25 2017 -0500
Committer: davebshow <davebshow@gmail.com>
Committed: Fri Feb 17 11:36:57 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/gremlin_python/driver/protocol.py       | 1 -
 gremlin-python/src/main/jython/tests/conftest.py            | 9 +++++----
 gremlin-python/src/main/jython/tests/driver/test_client.py  | 5 -----
 3 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa848c1a/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py b/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
index 2ace35e..279a8f5 100644
--- a/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
+++ b/gremlin-python/src/main/jython/gremlin_python/driver/protocol.py
@@ -95,7 +95,6 @@ class GremlinServerWSProtocol(AbstractBaseProtocol):
                 data = self._transport.read()
                 self.data_received(data, results_dict)
             else:
-                # result_set.done.set_result(None)
                 del results_dict[request_id]
         else:
             del results_dict[request_id]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa848c1a/gremlin-python/src/main/jython/tests/conftest.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/conftest.py b/gremlin-python/src/main/jython/tests/conftest.py
index 3ab64a8..49779ac 100644
--- a/gremlin-python/src/main/jython/tests/conftest.py
+++ b/gremlin-python/src/main/jython/tests/conftest.py
@@ -31,14 +31,15 @@ from gremlin_python.driver.tornado.transport import TornadoTransport
 
 @pytest.fixture
 def connection(request):
+    protocol = GremlinServerWSProtocol(
+        username='stephen', password='password')
+    executor = concurrent.futures.ThreadPoolExecutor(5)
+    pool = queue.Queue()
     try:
-        protocol = GremlinServerWSProtocol(
-            username='stephen', password='password')
-        executor = concurrent.futures.ThreadPoolExecutor(5)
-        pool = queue.Queue()
         conn = Connection('ws://localhost:45940/gremlin', 'g', protocol,
                           lambda: TornadoTransport(), executor, pool)
     except:
+        executor.shutdown()
         pytest.skip('Gremlin Server is not running')
     else:
         def fin():

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa848c1a/gremlin-python/src/main/jython/tests/driver/test_client.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_client.py b/gremlin-python/src/main/jython/tests/driver/test_client.py
index 6395d7b..2e0e96c 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_client.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_client.py
@@ -41,7 +41,6 @@ def test_client(client):
     message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
     result_set = client.submit(message)
     assert len(result_set.all().result()) == 6
-    client.close()
 
 def test_iterate_result_set(client):
     g = Graph().traversal()
@@ -52,7 +51,6 @@ def test_iterate_result_set(client):
     for result in result_set:
         results += result
     assert len(results) == 6
-    client.close()
 
 def test_client_async(client):
     g = Graph().traversal()
@@ -62,7 +60,6 @@ def test_client_async(client):
     assert not future.done()
     result_set = future.result()
     assert len(result_set.all().result()) == 6
-    client.close()
 
 def test_connection_share(client):
     # Overwrite fixture with pool_size=1 client
@@ -80,7 +77,6 @@ def test_connection_share(client):
     assert future.done()
     result_set = future.result()
     assert len(result_set.all().result()) == 6
-    client.close()
 
 def test_multi_conn_pool(client):
     g = Graph().traversal()
@@ -95,4 +91,3 @@ def test_multi_conn_pool(client):
     # with connection pool `future` may or may not be done here
     result_set = future.result()
     assert len(result_set.all().result()) == 6
-    client.close()


Mime
View raw message