Skip to content

Commit 6e29f11

Browse files
authored
Py.test 6 support (#752)
* Support Py.test 6+ * Run CI on Py.test 6 on new Pythons
1 parent 688d131 commit 6e29f11

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

.travis.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,49 @@ matrix:
1111
include:
1212
- os: linux
1313
python: 2.7
14+
env:
15+
- PYTEST_VERSION=4.3.1
1416
- os: linux
1517
python: 2.7
1618
env:
1719
- CDECIMAL=m3-cdecimal
20+
- PYTEST_VERSION=4.3.1
1821
- os: linux
1922
dist: trusty
2023
python: pypy
24+
env:
25+
- PYTEST_VERSION=4.3.1
2126
- os: linux
2227
dist: trusty
2328
python: pypy3
29+
env:
30+
- PYTEST_VERSION=6.1.2
2431
- os: linux
2532
python: 3.4
33+
env:
34+
- PYTEST_VERSION=4.3.1
2635
- os: linux
2736
python: 3.5
2837
env:
2938
- PYTHON_TEST_FLAGS=-bb
39+
- PYTEST_VERSION=6.1.2
3040
- os: linux
3141
python: 3.6
42+
env:
43+
- PYTEST_VERSION=6.1.2
3244
- os: linux
3345
python: 3.7
46+
env:
47+
- PYTEST_VERSION=6.1.2
3448
- os: linux
3549
python: 3.8
50+
env:
51+
- PYTEST_VERSION=6.1.2
3652

3753
install:
3854
- bash .ci/deps.${TRAVIS_OS_NAME}.sh
3955
- pip install --upgrade pip
40-
- pip install --upgrade $CDECIMAL pytest==4.3.1 pytest-cov==2.6.1 freezegun==0.3.12 'backports.zoneinfo;python_version>="3.6" and python_version<"3.9"'
56+
- pip install --upgrade $CDECIMAL pytest==$PYTEST_VERSION pytest-cov freezegun==0.3.12 'backports.zoneinfo;python_version>="3.6" and python_version<"3.9"'
4157
- pip install --editable .
4258

4359
script:

conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
def pytest_collect_file(path, parent):
99
if babel_path.common(path) == babel_path:
1010
if path.ext == ".py":
11+
# TODO: remove check when dropping support for old Pytest
12+
if hasattr(DoctestModule, "from_parent"):
13+
return DoctestModule.from_parent(parent, fspath=path)
1114
return DoctestModule(path, parent)

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ envlist = py27, pypy, py34, py35, py36, py37, pypy3, py27-cdecimal
33

44
[testenv]
55
deps =
6-
pytest==4.3.1
7-
pytest-cov==2.6.1
6+
pytest==4.3.1;python_version<"3.5"
7+
pytest==6.1.2;python_version>="3.5"
8+
pytest-cov
89
cdecimal: m3-cdecimal
910
freezegun==0.3.12
1011
backports.zoneinfo;python_version>"3.6" and python_version<"3.9"

0 commit comments

Comments
 (0)