From ebc1925a0bddffc33f54ac6067ee32482d42d23a Mon Sep 17 00:00:00 2001 From: Spencer Phillip Young Date: Wed, 13 Jul 2022 19:45:11 -0700 Subject: [PATCH] skip removal tests in Python<3.8 --- tests/test_unasync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_unasync.py b/tests/test_unasync.py index 6f198d0..7642949 100644 --- a/tests/test_unasync.py +++ b/tests/test_unasync.py @@ -4,6 +4,7 @@ import os import shutil import subprocess +import sys import pytest @@ -36,7 +37,8 @@ def test_rule_on_short_path(): @pytest.mark.parametrize("source_file", TEST_FILES) def test_unasync(tmpdir, source_file): - + if source_file == 'removals.py' and sys.version_info[2] < 8: + pytest.skip("unasync: remove feature is not supported in versions of Python less than 3.8") rule = unasync.Rule(fromdir=ASYNC_DIR, todir=str(tmpdir)) rule._unasync_file(os.path.join(ASYNC_DIR, source_file)) @@ -56,6 +58,8 @@ def test_unasync_files(tmpdir): ) for source_file in TEST_FILES: + if source_file == 'removals.py' and sys.version_info[2] < 8: + continue # unasync-remove feature is not supported in versions of Python less than 3.8 encoding = "latin-1" if "encoding" in source_file else "utf-8" with io.open(os.path.join(SYNC_DIR, source_file), encoding=encoding) as f: truth = f.read()