amoghrajesh commented on code in PR #57853:
URL: https://github.com/apache/airflow/pull/57853#discussion_r2517659486
##########
airflow-core/tests/unit/serialization/test_dag_serialization.py:
##########
@@ -113,31 +113,30 @@ def operator_defaults(overrides):
with operator_defaults({"retries": 2, "retry_delay": 200.0}):
# Test code with modified operator defaults
"""
+ import airflow.sdk.definitions._internal.abstractoperator as
abstract_op_module
from airflow.sdk.bases.operator import OPERATOR_DEFAULTS
+ from airflow.serialization.serialized_objects import SerializedBaseOperator
original_values = {}
- try:
- # Store original values and apply overrides
- for key, value in overrides.items():
- original_values[key] = OPERATOR_DEFAULTS.get(key)
- OPERATOR_DEFAULTS[key] = value
+ with pytest.MonkeyPatch.context() as monkeypatch:
Review Comment:
Yeah I thought of that initially. Wasn't sure if it was needed, but it would
be worthwhile as you said.
--
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]