File: test_utils.py

package info (click to toggle)
findpython 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 216 kB
  • sloc: python: 1,428; makefile: 48
file content (27 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest

from findpython.utils import WINDOWS, looks_like_python

matrix = [
    ("python", True),
    ("python3", True),
    ("python38", True),
    ("python3.8", True),
    ("python3.10", True),
    ("python310", True),
    ("python3.6m", True),
    ("python3.6.8m", False),
    ("anaconda3.3", True),
    ("python-3.8.10", False),
    ("unknown-2.0.0", False),
    ("python3.8.unknown", False),
    ("python38.bat", WINDOWS),
    ("python38.exe", WINDOWS),
    ("python38.sh", not WINDOWS),
    ("python38.csh", not WINDOWS),
]


@pytest.mark.parametrize("name, expected", matrix)
def test_looks_like_python(name, expected):
    assert looks_like_python(name) == expected