potiuk commented on a change in pull request #22311:
URL: https://github.com/apache/airflow/pull/22311#discussion_r831038630



##########
File path: tests/system/conftest.py
##########
@@ -0,0 +1,61 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import os
+import re
+from itertools import chain
+from pathlib import Path
+
+import pytest
+
+OLD_EXECUTOR = os.environ.get("AIRFLOW__CORE__EXECUTOR", default=None)
+REQUIRED_ENV_VARS = ("SYSTEM_TESTS_ENV_ID",)
+
+
+def pytest_configure(config):
+    os.environ["AIRFLOW__CORE__EXECUTOR"] = "DebugExecutor"
+
+
+def pytest_unconfigure(config):
+    if OLD_EXECUTOR is not None:
+        os.environ["AIRFLOW__CORE__EXECUTOR"] = OLD_EXECUTOR

Review comment:
       > Ah you're right, in this case if the env var was not set we should 
unset it. We will try with mock patching (like in your example).
   
   Yep. this is what I also had in mind with yield/patch for autofixture.
   




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