|
8 | 8 | describe "finding the right python":
|
9 | 9 | it "defaults max version to whatever python3, python and sys.executable are":
|
10 | 10 | with pytest.helpers.PATH.configure(
|
11 |
| - 3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.8 |
| 11 | + 3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys=3.9 |
12 | 12 | ):
|
13 |
| - PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.8] |
| 13 | + PythonHandler("3.7", None).find() == pytest.helpers.pythons[3.9] |
14 | 14 |
|
15 | 15 | with pytest.helpers.PATH.configure(
|
16 |
| - 3.6, 3.8, 3.9, python3=3.9, python=3.8, mock_sys=3.8 |
| 16 | + 3.7, 3.9, "3.10", python3=3.10, python=3.9, mock_sys=3.9 |
17 | 17 | ):
|
18 |
| - PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.9] |
| 18 | + PythonHandler("3.7", None).find() == pytest.helpers.pythons["3.10"] |
19 | 19 |
|
20 | 20 | with pytest.helpers.PATH.configure(
|
21 |
| - 3.6, 3.8, 3.9, python3=3.8, python=3.9, mock_sys=3.8 |
| 21 | + 3.7, 3.9, "3.10", python3=3.9, python="3.10", mock_sys=3.9 |
22 | 22 | ):
|
23 |
| - PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.9] |
| 23 | + PythonHandler("3.7", None).find() == pytest.helpers.pythons["3.10"] |
24 | 24 |
|
25 | 25 | with pytest.helpers.PATH.configure(
|
26 |
| - 3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.9 |
| 26 | + 3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys="3.10" |
27 | 27 | ):
|
28 |
| - PythonHandler("3.6", None).find() == pytest.helpers.pythons[3.9] |
| 28 | + PythonHandler("3.7", None).find() == pytest.helpers.pythons["3.10"] |
29 | 29 |
|
30 | 30 | it "respects the actual max":
|
31 | 31 | with pytest.helpers.PATH.configure(
|
32 |
| - 3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.8 |
| 32 | + 3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys=3.9 |
33 | 33 | ):
|
34 |
| - PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7] |
| 34 | + PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8] |
35 | 35 |
|
36 | 36 | with pytest.helpers.PATH.configure(
|
37 |
| - 3.6, 3.8, 3.9, python3=3.9, python=3.8, mock_sys=3.8 |
| 37 | + 3.7, 3.9, "3.10", python3="3.10", python=3.9, mock_sys=3.9 |
38 | 38 | ):
|
39 |
| - PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7] |
| 39 | + PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8] |
40 | 40 |
|
41 | 41 | with pytest.helpers.PATH.configure(
|
42 |
| - 3.6, 3.8, 3.9, python3=3.8, python=3.9, mock_sys=3.8 |
| 42 | + 3.7, 3.9, "3.10", python3=3.9, python="3.10", mock_sys=3.9 |
43 | 43 | ):
|
44 |
| - PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7] |
| 44 | + PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8] |
45 | 45 |
|
46 | 46 | with pytest.helpers.PATH.configure(
|
47 |
| - 3.6, 3.8, 3.9, python3=3.8, python=3.8, mock_sys=3.9 |
| 47 | + 3.7, 3.9, "3.10", python3=3.9, python=3.9, mock_sys="3.10" |
48 | 48 | ):
|
49 |
| - PythonHandler("3.6", "3.7").find() == pytest.helpers.pythons[3.7] |
| 49 | + PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8] |
50 | 50 |
|
51 | 51 | it "defaults max to the specified min if the main ones are less":
|
52 | 52 | with pytest.helpers.PATH.configure(
|
53 |
| - 3.6, 3.8, 3.9, python3=3.6, python=3.6, mock_sys=3.6 |
| 53 | + 3.7, 3.9, "3.10", python3=3.7, python=3.7, mock_sys=3.7 |
54 | 54 | ):
|
55 | 55 | with pytest.raises(
|
56 | 56 | Exception,
|
57 |
| - match="Couldn't find a suitable python!\nWanted between 3.7.0 and 3.7.0", |
| 57 | + match="Couldn't find a suitable python!\nWanted between 3.8.0 and 3.8.0", |
58 | 58 | ):
|
59 |
| - PythonHandler("3.7", None).find() |
| 59 | + PythonHandler("3.8", None).find() |
60 | 60 |
|
61 | 61 | it "steps through versions":
|
62 | 62 | with pytest.helpers.PATH.configure(
|
63 |
| - 3.6, 3.8, 3.9, python3=3.9, python=3.6, mock_sys=3.9 |
| 63 | + 3.7, 3.9, "3.10", python3="3.10", python=3.7, mock_sys="3.10" |
64 | 64 | ):
|
65 |
| - PythonHandler("3.7", "3.8").find() == pytest.helpers.pythons[3.8] |
| 65 | + PythonHandler("3.8", "3.9").find() == pytest.helpers.pythons[3.9] |
66 | 66 |
|
67 | 67 | it "works when there is only one version":
|
68 |
| - with pytest.helpers.PATH.configure(3.7, python3=3.7, python=3.7, mock_sys=3.7): |
69 |
| - PythonHandler(3.7, 3.7).find() == pytest.helpers.pythons[3.7] |
| 68 | + with pytest.helpers.PATH.configure(3.8, python3=3.8, python=3.8, mock_sys=3.8): |
| 69 | + PythonHandler(3.8, 3.8).find() == pytest.helpers.pythons[3.8] |
0 commit comments