potiuk commented on code in PR #59883:
URL: https://github.com/apache/airflow/pull/59883#discussion_r2668019399


##########
airflow-core/tests/unit/listeners/test_listeners.py:
##########
@@ -159,27 +151,25 @@ def 
test_listener_captures_longrunning_taskinstances(create_task_instance_of_ope
 
 
 @provide_session
-def test_class_based_listener(create_task_instance, session):
-    lm = get_listener_manager()
+def test_class_based_listener(create_task_instance, session, listener_manager):
     listener = class_listener.ClassBasedListener()
-    lm.add_listener(listener)
+    listener_manager(listener)
 
     ti = create_task_instance(session=session, state=TaskInstanceState.QUEUED)
     ti.run()
 
     assert listener.state == [TaskInstanceState.RUNNING, 
TaskInstanceState.SUCCESS, DagRunState.SUCCESS]
 
 
-def test_listener_logs_call(caplog, create_task_instance, session):
-    caplog.set_level(logging.DEBUG, logger="airflow.listeners.listener")
-    lm = get_listener_manager()
-    lm.add_listener(full_listener)
+def test_listener_logs_call(caplog, create_task_instance, session, 
listener_manager):
+    caplog.set_level(logging.DEBUG, 
logger="airflow.sdk._shared.listeners.listener")

Review Comment:
   Hmm. I think this should be fixed and we should separate those somehow - 
because if we do it this way, we will never be able to run tests on 
airflow-core without task-sdk being installed - which should be the mai 
guardrail for us to not accidentally depend on task-sdk. 
   
   But - we can deal with it later.



-- 
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]

Reply via email to