Run Python 3.10 under coverage (#818)
Since the matching code is Python 3.10-specific, we run it under coverage.
This commit is contained in:
parent
8613af97bb
commit
6731eea0ed
|
@ -13,12 +13,12 @@ jobs:
|
||||||
name: "Python ${{ matrix.python-version }}"
|
name: "Python ${{ matrix.python-version }}"
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
env:
|
env:
|
||||||
USING_COVERAGE: "2.7,3.7,3.8"
|
USING_COVERAGE: "2.7,3.7,3.8,3.10.0-beta - 3.10"
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10.0-alpha - 3.10", "pypy2", "pypy3"]
|
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10.0-beta - 3.10", "pypy2", "pypy3"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v2"
|
- uses: "actions/checkout@v2"
|
||||||
|
@ -40,7 +40,7 @@ jobs:
|
||||||
# parsing errors in older versions for modern code.
|
# parsing errors in older versions for modern code.
|
||||||
- uses: "actions/setup-python@v2"
|
- uses: "actions/setup-python@v2"
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.10.0-beta - 3.10"
|
||||||
|
|
||||||
- name: "Combine coverage"
|
- name: "Combine coverage"
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -4,6 +4,8 @@ import sys
|
||||||
|
|
||||||
from hypothesis import HealthCheck, settings
|
from hypothesis import HealthCheck, settings
|
||||||
|
|
||||||
|
from attr._compat import PY310
|
||||||
|
|
||||||
|
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
||||||
# HealthCheck.too_slow causes more trouble than good -- especially in CIs.
|
# HealthCheck.too_slow causes more trouble than good -- especially in CIs.
|
||||||
|
@ -23,9 +25,9 @@ if sys.version_info[:2] < (3, 6):
|
||||||
"tests/test_next_gen.py",
|
"tests/test_next_gen.py",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
if sys.version_info[:2] < (3, 10):
|
if not PY310:
|
||||||
collect_ignore.extend(["tests/test_pattern_matching.py"])
|
collect_ignore.extend(["tests/test_pattern_matching.py"])
|
||||||
if sys.version_info[:2] >= (3, 10):
|
if PY310:
|
||||||
collect_ignore.extend(
|
collect_ignore.extend(
|
||||||
[
|
[
|
||||||
"tests/test_mypy.yml",
|
"tests/test_mypy.yml",
|
||||||
|
|
|
@ -8,6 +8,7 @@ import warnings
|
||||||
|
|
||||||
PY2 = sys.version_info[0] == 2
|
PY2 = sys.version_info[0] == 2
|
||||||
PYPY = platform.python_implementation() == "PyPy"
|
PYPY = platform.python_implementation() == "PyPy"
|
||||||
|
PY310 = sys.version_info[:2] >= (3, 10)
|
||||||
|
|
||||||
|
|
||||||
if PYPY or sys.version_info[:2] >= (3, 6):
|
if PYPY or sys.version_info[:2] >= (3, 6):
|
||||||
|
|
15
tox.ini
15
tox.ini
|
@ -61,10 +61,21 @@ extras = {env:TOX_AP_TEST_EXTRAS:tests}
|
||||||
commands = coverage run -m pytest {posargs}
|
commands = coverage run -m pytest {posargs}
|
||||||
|
|
||||||
|
|
||||||
|
[testenv:py310]
|
||||||
|
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
|
||||||
|
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
|
||||||
|
basepython = python3.10
|
||||||
|
install_command = pip install --no-compile {opts} {packages}
|
||||||
|
setenv =
|
||||||
|
PYTHONWARNINGS=d
|
||||||
|
extras = {env:TOX_AP_TEST_EXTRAS:tests}
|
||||||
|
commands = coverage run -m pytest {posargs}
|
||||||
|
|
||||||
|
|
||||||
[testenv:coverage-report]
|
[testenv:coverage-report]
|
||||||
basepython = python3.7
|
basepython = python3.10
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps = coverage[toml]>=5.0.2
|
deps = coverage[toml]>=5.4
|
||||||
commands =
|
commands =
|
||||||
coverage combine
|
coverage combine
|
||||||
coverage report
|
coverage report
|
||||||
|
|
Loading…
Reference in New Issue