diff --git a/neo4j/__init__.py b/neo4j/__init__.py index 7567d91f4..12627494a 100644 --- a/neo4j/__init__.py +++ b/neo4j/__init__.py @@ -651,8 +651,6 @@ def _run_transaction(self, access_mode, unit_of_work, *args, **kwargs): if not callable(unit_of_work): raise TypeError("Unit of work is not callable") - metadata = getattr(unit_of_work, "metadata", None) - print(metadata) # TODO retry_delay = retry_delay_generator(INITIAL_RETRY_DELAY, RETRY_DELAY_MULTIPLIER, RETRY_DELAY_JITTER_FACTOR) diff --git a/test/integration/test_session.py b/test/integration/test_session.py index 4f3cfab51..257c2fa4e 100644 --- a/test/integration/test_session.py +++ b/test/integration/test_session.py @@ -19,10 +19,13 @@ # limitations under the License. +import sys from time import sleep from unittest import SkipTest from uuid import uuid4 +from six import StringIO + from neo4j import \ READ_ACCESS, WRITE_ACCESS, \ CypherError, SessionError, TransactionError, unit_of_work, Statement @@ -543,6 +546,20 @@ def test_large_values(self): session.run("RETURN '{}'".format("A" * 2 ** 20)) session.close() + def test_nothing_written_to_stdout_during_session(self): + captured_output = StringIO() + sys.stdout = captured_output + + def work(tx): + return tx.run("RETURN 1") + + with self.driver.session() as session: + session.write_transaction(work) + + sys.stdout = sys.__stdout__ + + self.assertEqual(captured_output.getvalue(), "") + class TransactionCommittedTestCase(DirectIntegrationTestCase): diff --git a/test/requirements.txt b/test/requirements.txt index 8f7c845b8..013fbbfaa 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -4,5 +4,6 @@ mock pytest pytest-benchmark pytest-cov +six teamcity-messages tox