Skip to content

Commit f9a13fe

Browse files
committed
Drop support to old pytest versions and test with python 3.7
1 parent 74a5e0c commit f9a13fe

File tree

8 files changed

+35
-54
lines changed

8 files changed

+35
-54
lines changed

.travis.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,9 @@ notifications:
1111
email:
1212
1313

14-
python:
15-
- '2.7'
16-
- '3.4'
17-
- '3.5'
18-
- '3.6'
19-
env:
20-
- TOXENV=py-pytest30
21-
- TOXENV=py-pytest31
22-
- TOXENV=py-pytest32
23-
- TOXENV=py-pytest33
24-
25-
install: pip install tox setuptools_scm
14+
install:
15+
- pip install -U pip
16+
- pip install tox setuptools_scm
2617
script: tox
2718

2819
stages:
@@ -42,7 +33,14 @@ jobs:
4233
env: TOXENV=py27-pytestlatest
4334

4435
- stage: test
45-
# python x env above are already included into this stage
36+
python: "3.4"
37+
env: TOXENV=py34-pytestlatest
38+
- python: "3.5"
39+
env: TOXENV=py35-pytestlatest
40+
- python: "3.7"
41+
env: TOXENV=py37-pytestlatest
42+
sudo: required
43+
dist: xenial
4644
- python: "2.7"
4745
env: TOXENV=py27-pytestmaster
4846
- python: "2.7"

appveyor.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
environment:
22
matrix:
3-
# note: please use "tox --listenvs" to populate the build matrix
4-
- TOXENV: "py27-pytest33"
5-
- TOXENV: "py34-pytest33"
6-
- TOXENV: "py35-pytest33"
7-
- TOXENV: "py36-pytest33"
3+
- TOXENV: "py27-pytestlatest"
4+
- TOXENV: "py34-pytestlatest"
5+
- TOXENV: "py35-pytestlatest"
86
- TOXENV: "py36-pytestlatest"
9-
- TOXENV: "py27-pytest33-pexpect"
10-
- TOXENV: "py36-pytest33-pexpect"
7+
- TOXENV: "py37-pytestlatest"
8+
- TOXENV: "py27-pytestmaster"
9+
- TOXENV: "py36-pytestmaster"
10+
- TOXENV: "py27-pytestfeatures"
11+
- TOXENV: "py36-pytestfeatures"
1112

1213
install:
13-
- C:\Python36\python -m pip install -U tox setuptools_scm pip
14+
- C:\Python37\python -m pip install -U pip
15+
- C:\Python37\python -m pip install -U tox setuptools_scm
1416

1517
build: false # Not a C# project, build stuff at the test step instead.
1618

1719
test_script:
18-
- C:\Python36\python -m tox
20+
- C:\Python37\python -m tox
1921

2022
# We don't deploy anything on tags with AppVeyor, we use Travis instead, so we
2123
# might as well save resources

changelog/372.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pytest versions older than 3.6 are no longer supported.

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
install_requires = ["execnet>=1.1", "pytest>=3.0.0", "pytest-forked", "six"]
3+
install_requires = ["execnet>=1.1", "pytest>=3.6.0", "pytest-forked", "six"]
44

55

66
setup(
@@ -40,5 +40,6 @@
4040
"Programming Language :: Python :: 3.4",
4141
"Programming Language :: Python :: 3.5",
4242
"Programming Language :: Python :: 3.6",
43+
"Programming Language :: Python :: 3.7",
4344
],
4445
)

testing/acceptance_test.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -708,16 +708,6 @@ def test_ok():
708708

709709

710710
class TestWarnings:
711-
@pytest.fixture(autouse=True)
712-
def skip_if_unsupported_pytest_version(self):
713-
"""Skip tests of this class if we are running in a pytest version which does not
714-
support warnings yet.
715-
"""
716-
from pkg_resources import parse_version
717-
718-
if parse_version(pytest.__version__) < parse_version("3.1"):
719-
pytest.skip("pytest warnings requires >= 3.1")
720-
721711
@pytest.mark.parametrize("n", ["-n0", "-n1"])
722712
@pytest.mark.parametrize("warn_type", ["pytest", "builtin"])
723713
def test_warnings(self, testdir, n, warn_type):

testing/test_looponfail.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import py
2+
import pytest
3+
from pkg_resources import parse_version
4+
25
from xdist.looponfail import RemoteControl
36
from xdist.looponfail import StatRecorder
47

@@ -214,7 +217,11 @@ def test_two():
214217
assert "test_one" not in remotecontrol.failures[0]
215218
assert "test_two" in remotecontrol.failures[0]
216219

217-
@py.test.mark.xfail(py.test.__version__ >= "3.1", reason="broken by pytest 3.1+")
220+
@pytest.mark.xfail(
221+
parse_version(pytest.__version__) >= parse_version("3.1"),
222+
reason="broken by pytest 3.1+",
223+
strict=True,
224+
)
218225
def test_looponfail_removed_test(self, testdir):
219226
modcol = testdir.getmodulecol(
220227
"""

testing/test_remote.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import py
22
import pprint
33
import pytest
4-
from pkg_resources import parse_version
54

65
from xdist.workermanage import WorkerController, unserialize_report
76
from xdist.remote import serialize_report
@@ -294,10 +293,6 @@ def test_func():
294293
ev = worker.popevent("workerfinished")
295294
assert "workeroutput" in ev.kwargs
296295

297-
@pytest.mark.skipif(
298-
parse_version(pytest.__version__) < parse_version("3.3"),
299-
reason="skip at module level illegal in this pytest version",
300-
)
301296
def test_remote_collect_skip(self, worker):
302297
worker.testdir.makepyfile(
303298
"""

tox.ini

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
11
[tox]
2-
# if you change the envlist, please update .travis.yml file as well
32
envlist=
43
linting
5-
py{27,34,35,36}-pytest{30,31,32,33,latest}
6-
py{27,36}-pytest36-pexpect
4+
py{27,34,35,36,37}-pytestlatest
75
py{27,36}-pytest{master,features}
86

9-
107
[testenv]
118
changedir=testing
129
passenv = USER USERNAME
1310
deps =
14-
pycmd
15-
# to avoid .eggs
16-
setuptools_scm
17-
pytest30: pytest~=3.0.5
18-
pytest31: pytest~=3.1.0
19-
pytest32: pytest~=3.2.0
20-
pytest33: pytest~=3.3.0
2111
pytestlatest: pytest
2212
pytestmaster: git+https://github.com/pytest-dev/pytest.git@master
2313
pytestfeatures: git+https://github.com/pytest-dev/pytest.git@features
24-
pexpect: pexpect
2514
filelock
26-
platform=
27-
pexpect: linux|darwin
2815
commands=
2916
pytest {posargs}
3017

@@ -48,7 +35,7 @@ commands =
4835
towncrier --version {posargs} --yes
4936

5037
[pytest]
51-
addopts = -rsfxX
38+
addopts = -ra
5239

5340
[flake8]
5441
max-line-length = 120

0 commit comments

Comments
 (0)