Skip to content

Commit ebc1925

Browse files
committed
skip removal tests in Python<3.8
1 parent 7579ace commit ebc1925

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_unasync.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import shutil
66
import subprocess
7+
import sys
78

89
import pytest
910

@@ -36,7 +37,8 @@ def test_rule_on_short_path():
3637

3738
@pytest.mark.parametrize("source_file", TEST_FILES)
3839
def test_unasync(tmpdir, source_file):
39-
40+
if source_file == 'removals.py' and sys.version_info[2] < 8:
41+
pytest.skip("unasync: remove feature is not supported in versions of Python less than 3.8")
4042
rule = unasync.Rule(fromdir=ASYNC_DIR, todir=str(tmpdir))
4143
rule._unasync_file(os.path.join(ASYNC_DIR, source_file))
4244

@@ -56,6 +58,8 @@ def test_unasync_files(tmpdir):
5658
)
5759

5860
for source_file in TEST_FILES:
61+
if source_file == 'removals.py' and sys.version_info[2] < 8:
62+
continue # unasync-remove feature is not supported in versions of Python less than 3.8
5963
encoding = "latin-1" if "encoding" in source_file else "utf-8"
6064
with io.open(os.path.join(SYNC_DIR, source_file), encoding=encoding) as f:
6165
truth = f.read()

0 commit comments

Comments
 (0)