kokorin commented on code in PR #26105:
URL: https://github.com/apache/airflow/pull/26105#discussion_r964332641


##########
tests/www/views/test_views_log.py:
##########
@@ -163,6 +169,25 @@ def tis(dags, session):
     clear_db_runs()
 
 
[email protected]
+def create_expected_log_file(log_path, tis):
+    ti, _ = tis
+    handler = FileTaskHandler(log_path)
+
+    def create_expected_log_file(try_number):
+        ti.try_number = try_number - 1
+        handler.set_context(ti)
+        handler.emit(logging.makeLogRecord({"msg": "Log for testing."}))
+        handler.flush()
+
+    yield create_expected_log_file
+    # log_path fixture has scope "module" because it is used in log_app which 
has module scope, so
+    # log_path isn't deleted automatically by pytest between tests
+    # we delete created log files manually to make sure tests do not reuse 
logs created by other tests
+    for sub_path in log_path.glob("*"):

Review Comment:
   applied



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