You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/01/30 00:13:05 UTC
[airflow] branch v1-10-stable updated: Upgrade tool: skip bad file
test for Python 2.7 (#13981)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v1-10-stable
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-stable by this push:
new 6373a5e Upgrade tool: skip bad file test for Python 2.7 (#13981)
6373a5e is described below
commit 6373a5e314afccdc1244246c7e9d91ffed39a015
Author: Madison Bowden <52...@users.noreply.github.com>
AuthorDate: Fri Jan 29 16:11:46 2021 -0800
Upgrade tool: skip bad file test for Python 2.7 (#13981)
---
tests/upgrade/rules/test_airflow_macro_plugin_removed.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/upgrade/rules/test_airflow_macro_plugin_removed.py b/tests/upgrade/rules/test_airflow_macro_plugin_removed.py
index bbf18ce..0941bd1 100644
--- a/tests/upgrade/rules/test_airflow_macro_plugin_removed.py
+++ b/tests/upgrade/rules/test_airflow_macro_plugin_removed.py
@@ -14,12 +14,15 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+import sys
from contextlib import contextmanager
+from tempfile import NamedTemporaryFile
from unittest import TestCase
-from tempfile import NamedTemporaryFile
from tests.compat import mock
+import pytest
+
from airflow.upgrade.rules.airflow_macro_plugin_removed import (
AirflowMacroPluginRemovedRule,
)
@@ -80,6 +83,10 @@ class TestAirflowMacroPluginRemovedRule(TestCase):
msgs = rule.check()
assert 0 == len(msgs)
+ @pytest.mark.skipif(
+ sys.version_info.major == 2,
+ reason="Test is irrelevant in Python 2.7 because of unicode differences"
+ )
def test_bad_file_failure(self, mock_list_files):
# Write a binary file
with NamedTemporaryFile("wb+", suffix=".py") as temp_file: