You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/23 06:58:30 UTC

[GitHub] [airflow] mcepok commented on a change in pull request #14913: Upgrade rule to suggest to rename max_threads to parsing_processes

mcepok commented on a change in pull request #14913:
URL: https://github.com/apache/airflow/pull/14913#discussion_r599312664



##########
File path: tests/upgrade/rules/test_parsing_processes_configuration_rule.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.
+from unittest import TestCase
+
+from airflow.configuration import conf
+from airflow.upgrade.rules.parsing_processes_configuration_rule import ParsingProcessesConfigurationRule
+from tests.test_utils.config import conf_vars
+
+
+class TestParsingProcessesConfigurationRule(TestCase):
+    @conf_vars(
+        {
+            ("scheduler", "parsing_processes"): "DUMMY",
+        }
+    )
+    def test_check_new_config(self):
+        rule = ParsingProcessesConfigurationRule()
+
+        assert isinstance(rule.description, str)
+        assert isinstance(rule.title, str)
+
+        # Remove the fallback option
+        conf.deprecated_options.get("scheduler", {}).pop("parsing_processes", "")
+        conf.remove_option("scheduler", "parsing_processes")

Review comment:
       I see, thanks for the feedback. I adjusted the tests with mocks.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org