Skip to content

Commit fa84635

Browse files
committed
New Python versions in tests
1 parent 0d9beab commit fa84635

6 files changed

Lines changed: 40 additions & 27 deletions

File tree

.github/workflows/main.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@ jobs:
2121
tox_env:
2222
# This information is repeated in tox.ini
2323
# (see https://github.com/fedora-python/tox-github-action/issues/8)
24-
- py36-tox315
25-
- py37-tox315
26-
- py38-tox315
27-
- py39-tox315
28-
24+
# Generate it by: tox -l | sed "s/^/- /"
2925
- py36-toxrelease
30-
- py37-toxrelease
31-
- py38-toxrelease
32-
- py39-toxrelease
33-
3426
- py36-toxmaster
27+
- py36-toxtox315
28+
- py37-toxrelease
3529
- py37-toxmaster
30+
- py37-toxtox315
31+
- py38-toxrelease
3632
- py38-toxmaster
33+
- py38-toxtox315
34+
- py39-toxrelease
3735
- py39-toxmaster
36+
- py39-toxtox315
37+
- py310-toxrelease
38+
- py310-toxmaster
39+
- py310-toxtox315
3840

3941
# Use GitHub's Linux Docker host
4042
runs-on: ubuntu-latest

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ or send Pull Requests.
280280
Tests
281281
~~~~~
282282

283-
In order to run the tests, you'll need ``tox`` and Python 3.6, 3.7, 3.8 and 3.9 installed.
284-
The integration tests assume all four are available.
283+
In order to run the tests, you'll need ``tox`` and Python from 3.6 to 3.10 installed.
284+
The integration tests assume all of them are available.
285285
On Fedora, you just need to ``dnf install tox``.
286286

287287
Run ``tox`` to invoke the tests.

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def long_description():
3434
"Programming Language :: Python :: 3.7",
3535
"Programming Language :: Python :: 3.8",
3636
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python :: 3.10",
3738
"Programming Language :: Python :: Implementation :: CPython",
3839
"Topic :: Software Development :: Testing",
3940
],

tests/fixtures/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36,py37,py38,py39
2+
envlist = py36,py37,py38,py39,py310
33

44
[testenv]
55
deps =

tests/test_integration.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
NATIVE_TOXENV = f"py{sys.version_info[0]}{sys.version_info[1]}"
19+
NATIVE_SITE_PACKAGES = f"lib/python{sys.version_info[0]}.{sys.version_info[1]}/site-packages"
1920
NATIVE_EXECUTABLE = str(pathlib.Path(sys.executable).resolve())
2021
FIXTURES_DIR = pathlib.Path(__file__).parent / "fixtures"
2122
DOT_TOX = pathlib.Path("./.tox")
@@ -100,9 +101,9 @@ def is_available(python):
100101
return True
101102

102103

103-
needs_py36789 = pytest.mark.skipif(
104-
not all((is_available(f"python3.{x}") for x in range(6, 10))),
105-
reason="This test needs python3.6, 3.7, 3.8 and 3.9 available in $PATH",
104+
needs_py3678910 = pytest.mark.skipif(
105+
not all((is_available(f"python3.{x}") for x in range(6, 12))),
106+
reason="This test needs python3.6, 3.7, 3.8, 3.9 and 3.10 available in $PATH",
106107
)
107108

108109

@@ -113,7 +114,7 @@ def test_native_toxenv_current_env():
113114
assert not (DOT_TOX / NATIVE_TOXENV / "lib").is_dir()
114115

115116

116-
@needs_py36789
117+
@needs_py3678910
117118
def test_all_toxenv_current_env():
118119
result = tox("--current-env", check=False)
119120
assert NATIVE_EXEC_PREFIX_MSG in result.stdout.splitlines()
@@ -132,7 +133,7 @@ def test_missing_toxenv_current_env(python):
132133
assert result.returncode > 0
133134

134135

135-
@needs_py36789
136+
@needs_py3678910
136137
def test_all_toxenv_current_env_skip_missing():
137138
result = tox("--current-env", "--skip-missing-interpreters", check=False)
138139
assert "InterpreterMismatch:" in result.stdout
@@ -255,11 +256,14 @@ def test_allenvs_print_deps(print_deps_stdout_arg):
255256
py
256257
six
257258
py
259+
six
260+
py
258261
___________________________________ summary ____________________________________
259262
py36: commands succeeded
260263
py37: commands succeeded
261264
py38: commands succeeded
262265
py39: commands succeeded
266+
py310: commands succeeded
263267
congratulations :)
264268
"""
265269
).lstrip()
@@ -278,18 +282,21 @@ def test_allenvs_print_extras(print_extras_stdout_arg):
278282
full
279283
dev
280284
full
285+
dev
286+
full
281287
___________________________________ summary ____________________________________
282288
py36: commands succeeded
283289
py37: commands succeeded
284290
py38: commands succeeded
285291
py39: commands succeeded
292+
py310: commands succeeded
286293
congratulations :)
287294
"""
288295
).lstrip()
289296
assert result.stdout == expected
290297

291298

292-
@pytest.mark.parametrize("toxenv", ["py36", "py37", "py38", "py39"])
299+
@pytest.mark.parametrize("toxenv", ["py36", "py37", "py38", "py39", "py310"])
293300
def test_print_deps_to_file(toxenv, tmp_path):
294301
depspath = tmp_path / "deps"
295302
result = tox("-e", toxenv, "--print-deps-to", str(depspath))
@@ -304,7 +311,7 @@ def test_print_deps_to_file(toxenv, tmp_path):
304311
assert result.stdout == expected
305312

306313

307-
@pytest.mark.parametrize("toxenv", ["py36", "py37", "py38", "py39"])
314+
@pytest.mark.parametrize("toxenv", ["py36", "py37", "py38", "py39", "py310"])
308315
def test_print_extras_to_file(toxenv, tmp_path):
309316
extraspath = tmp_path / "extras"
310317
result = tox("-e", toxenv, "--print-extras-to", str(extraspath))
@@ -323,14 +330,15 @@ def test_print_extras_to_file(toxenv, tmp_path):
323330
def test_allenvs_print_deps_to_file(tmp_path, option):
324331
depspath = tmp_path / "deps"
325332
result = tox(option, str(depspath))
326-
assert depspath.read_text().splitlines() == ["six", "py"] * 4
333+
assert depspath.read_text().splitlines() == ["six", "py"] * 5
327334
expected = textwrap.dedent(
328335
"""
329336
___________________________________ summary ____________________________________
330337
py36: commands succeeded
331338
py37: commands succeeded
332339
py38: commands succeeded
333340
py39: commands succeeded
341+
py310: commands succeeded
334342
congratulations :)
335343
"""
336344
).lstrip()
@@ -341,14 +349,15 @@ def test_allenvs_print_deps_to_file(tmp_path, option):
341349
def test_allenvs_print_extras_to_file(tmp_path, option):
342350
extraspath = tmp_path / "extras"
343351
result = tox(option, str(extraspath))
344-
assert extraspath.read_text().splitlines() == ["dev", "full"] * 4
352+
assert extraspath.read_text().splitlines() == ["dev", "full"] * 5
345353
expected = textwrap.dedent(
346354
"""
347355
___________________________________ summary ____________________________________
348356
py36: commands succeeded
349357
py37: commands succeeded
350358
py38: commands succeeded
351359
py39: commands succeeded
360+
py310: commands succeeded
352361
congratulations :)
353362
"""
354363
).lstrip()
@@ -447,16 +456,17 @@ def test_print_deps_only_print_deps_to_file_are_mutually_exclusive():
447456
assert "cannot be used together" in result.stderr
448457

449458

450-
@needs_py36789
459+
@needs_py3678910
451460
def test_regular_run():
452461
result = tox()
453-
lines = sorted(result.stdout.splitlines()[:4])
462+
lines = result.stdout.splitlines()[:5]
454463
assert "/.tox/py36 is the exec_prefix" in lines[0]
455464
assert "/.tox/py37 is the exec_prefix" in lines[1]
456465
assert "/.tox/py38 is the exec_prefix" in lines[2]
457466
assert "/.tox/py39 is the exec_prefix" in lines[3]
467+
assert "/.tox/py310 is the exec_prefix" in lines[4]
458468
assert "congratulations" in result.stdout
459-
for y in 6, 7, 8, 9:
469+
for y in 6, 7, 8, 9, 10:
460470
for pkg in "py", "six", "test":
461471
sitelib = DOT_TOX / f"py3{y}/lib/python3.{y}/site-packages"
462472
assert sitelib.is_dir()
@@ -470,7 +480,7 @@ def test_regular_run_native_toxenv():
470480
assert "congratulations" in result.stdout
471481
for pkg in "py", "six", "test":
472482
sitelib = (
473-
DOT_TOX / f"{NATIVE_TOXENV}/lib/python3.{NATIVE_TOXENV[-1]}/site-packages"
483+
DOT_TOX / f"{NATIVE_TOXENV}/{NATIVE_SITE_PACKAGES}"
474484
)
475485
assert sitelib.is_dir()
476486
assert len(list(sitelib.glob(f"{pkg}-*.dist-info"))) == 1
@@ -565,7 +575,7 @@ def test_regular_recreate_after_print_deps(print_deps_stdout_arg):
565575

566576
result = tox("-re", NATIVE_TOXENV)
567577
assert result.stdout.splitlines()[0] != NATIVE_EXEC_PREFIX_MSG
568-
sitelib = DOT_TOX / f"{NATIVE_TOXENV}/lib/python3.{NATIVE_TOXENV[-1]}/site-packages"
578+
sitelib = DOT_TOX / f"{NATIVE_TOXENV}/{NATIVE_SITE_PACKAGES}"
569579
assert sitelib.is_dir()
570580
assert len(list(sitelib.glob("test-*.dist-info"))) == 1
571581

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# This information is repeated in .github/workflows/main.yaml
44
# (see https://github.com/fedora-python/tox-github-action/issues/8)
5-
envlist = {py36,py37,py38,py39}-tox{release,master,tox315}
5+
envlist = {py36,py37,py38,py39,py310}-tox{release,master,tox315}
66

77
[testenv]
88
deps=

0 commit comments

Comments
 (0)