Skip to content

Commit

Permalink
fix: remove tests for LegacyVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
finswimmer committed Dec 21, 2022
1 parent 7865618 commit 5980c29
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[
Expand All @@ -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):
Expand Down

0 comments on commit 5980c29

Please sign in to comment.