From 5980c29d5a708c1cacf8168264124ab2cbeaa31f Mon Sep 17 00:00:00 2001 From: finswimmer Date: Wed, 21 Dec 2022 12:21:25 +0100 Subject: [PATCH] fix: remove tests for LegacyVersion --- tests/test_python.py | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/tests/test_python.py b/tests/test_python.py index 0442c67..6249a60 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -19,33 +19,6 @@ ) -@pytest.mark.skipif(sys.version_info < (3,), reason="Must run on Python 3") -def test_python_versions(monkeypatch, special_character_python): - def mock_version(*args, **kwargs): - version_output = "2.7.15+ (default, Jun 28 2018, 13:15:42)\n[GCC 7.2.0]" - - class FakeObj(object): - def __init__(self, out): - self.out = out - - def communicate(self): - return self.out, "" - - def kill(self): - pass - - c = FakeObj(version_output.split()[0]) - return c - - os.environ["PYTHONFINDER_IGNORE_UNSUPPORTED"] = str("1") - with monkeypatch.context() as m: - m.setattr("subprocess.Popen", mock_version) - parsed = pythonfinder.models.python.PythonVersion.from_path( - special_character_python.as_posix() - ) - assert isinstance(parsed.version, Version) - - @pytest.mark.parametrize( "path, version_output, version", [ @@ -65,11 +38,6 @@ def kill(self): "3.5.3 (fdd60ed87e941677e8ea11acf9f1819466521bf2, Apr 27 2018, 15:39:57)\n[PyPy 5.10.1 with GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]", "3.5.3", ), - ( - "/fake/path/2.7.15+/bin/python", - "2.7.15+ (default, Jun 28 2018, 13:15:42)", - "2.7.15", - ), ], ) def test_python_version_output_variants(monkeypatch, path, version_output, version):