kokorin commented on code in PR #26105:
URL: https://github.com/apache/airflow/pull/26105#discussion_r963503623
##########
tests/www/views/test_views_log.py:
##########
@@ -163,6 +169,22 @@ 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
+ # delete logs to minimize tests interference
+ shutil.rmtree(log_path)
Review Comment:
@uranusjr in the PR I tried not to make any assumptions regarding log file
name. I will add a comment describing why manual log file deletion is required
and will find more clear to delete created log file.
--
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]