summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2020-11-11 10:35:35 +0200
committerGitHub <noreply@github.com>2020-11-11 10:35:35 +0200
commit6e29f11234a046fca4716b8804f8cd62c7b51166 (patch)
tree92af670c83eb8dcc203c9d5a4a6fee928ad7317a
parent688d1310e9adfa1c3543b563e275b3faffd88c96 (diff)
downloadbabel-6e29f11234a046fca4716b8804f8cd62c7b51166.tar.gz
Py.test 6 support (#752)
* Support Py.test 6+ * Run CI on Py.test 6 on new Pythons
-rw-r--r--.travis.yml18
-rw-r--r--conftest.py3
-rw-r--r--tox.ini5
3 files changed, 23 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index e7401cc..7f7331b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,33 +11,49 @@ matrix:
include:
- os: linux
python: 2.7
+ env:
+ - PYTEST_VERSION=4.3.1
- os: linux
python: 2.7
env:
- CDECIMAL=m3-cdecimal
+ - PYTEST_VERSION=4.3.1
- os: linux
dist: trusty
python: pypy
+ env:
+ - PYTEST_VERSION=4.3.1
- os: linux
dist: trusty
python: pypy3
+ env:
+ - PYTEST_VERSION=6.1.2
- os: linux
python: 3.4
+ env:
+ - PYTEST_VERSION=4.3.1
- os: linux
python: 3.5
env:
- PYTHON_TEST_FLAGS=-bb
+ - PYTEST_VERSION=6.1.2
- os: linux
python: 3.6
+ env:
+ - PYTEST_VERSION=6.1.2
- os: linux
python: 3.7
+ env:
+ - PYTEST_VERSION=6.1.2
- os: linux
python: 3.8
+ env:
+ - PYTEST_VERSION=6.1.2
install:
- bash .ci/deps.${TRAVIS_OS_NAME}.sh
- pip install --upgrade pip
- - 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"'
+ - pip install --upgrade $CDECIMAL pytest==$PYTEST_VERSION pytest-cov freezegun==0.3.12 'backports.zoneinfo;python_version>="3.6" and python_version<"3.9"'
- pip install --editable .
script:
diff --git a/conftest.py b/conftest.py
index 32bd136..bd9f2d3 100644
--- a/conftest.py
+++ b/conftest.py
@@ -8,4 +8,7 @@ babel_path = local(__file__).dirpath().join('babel')
def pytest_collect_file(path, parent):
if babel_path.common(path) == babel_path:
if path.ext == ".py":
+ # TODO: remove check when dropping support for old Pytest
+ if hasattr(DoctestModule, "from_parent"):
+ return DoctestModule.from_parent(parent, fspath=path)
return DoctestModule(path, parent)
diff --git a/tox.ini b/tox.ini
index c069c59..27faf5b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,8 +3,9 @@ envlist = py27, pypy, py34, py35, py36, py37, pypy3, py27-cdecimal
[testenv]
deps =
- pytest==4.3.1
- pytest-cov==2.6.1
+ pytest==4.3.1;python_version<"3.5"
+ pytest==6.1.2;python_version>="3.5"
+ pytest-cov
cdecimal: m3-cdecimal
freezegun==0.3.12
backports.zoneinfo;python_version>"3.6" and python_version<"3.9"