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