uranusjr commented on code in PR #42913:
URL: https://github.com/apache/airflow/pull/42913#discussion_r1825466772
##########
tests_common/pytest_plugin.py:
##########
@@ -1574,3 +1607,25 @@ def url_safe_serializer(secret_key) -> URLSafeSerializer:
from itsdangerous import URLSafeSerializer
return URLSafeSerializer(secret_key)
+
+
[email protected]
+def file_updater():
+ @contextmanager
+ def _file_updater(file_path):
+ original_content = None
+ try:
+ with open(file_path) as file:
+ original_content = file.read()
+ updated_content = original_content.replace("2021", "2024")
+
+ with open(file_path, "w") as file:
Review Comment:
I wonder if it would be better to use a temporary file instead of rewriting
the file in-place. Tests rewriting files in the code base sounds like a bad
idea.
--
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]