mik-laj commented on a change in pull request #18007:
URL: https://github.com/apache/airflow/pull/18007#discussion_r702140880
##########
File path: tests/providers/neo4j/operators/test_neo4j.py
##########
@@ -46,16 +28,13 @@
class TestNeo4jOperator(unittest.TestCase):
- def setUp(self):
- args = {'owner': 'airflow', 'start_date': DEFAULT_DATE}
- dag = DAG(TEST_DAG_ID, default_args=args)
- self.dag = dag
-
-
@mock.patch('airflow.providers.neo4j.operators.neo4j.Neo4jOperator.get_hook')
+ @mock.patch('airflow.providers.neo4j.operators.neo4j.Neo4jHook')
def test_neo4j_operator_test(self, mock_hook):
sql = """
MATCH (tom {name: "Tom Hanks"}) RETURN tom
"""
- op = Neo4jOperator(task_id='basic_neo4j', sql=sql, dag=self.dag)
- op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE,
ignore_ti_state=True)
Review comment:
This test took an unnecessarily long time - 6 seconds. We need a full
run, but running the execute method is enough. This test also lacked assertion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]