diff options
author | Aarni Koskela <akx@iki.fi> | 2019-05-27 10:17:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 10:17:57 +0300 |
commit | 88fe29b9c140320990e56fc350a8a92f58b850b4 (patch) | |
tree | 7fe0ba7d5a694a9802f64ecb70174c9d47ee2ff8 | |
parent | 69cda1d2082444ed99836d92135f175d20555463 (diff) | |
parent | 897fa81beb6236ff4f4e6402c49e257459dcacb7 (diff) | |
download | babel-88fe29b9c140320990e56fc350a8a92f58b850b4.tar.gz |
Merge pull request #635 from hroncok/pytest4
Fix conftest.py compatibility with pytest 4.3
-rw-r--r-- | .ci/appveyor.yml | 2 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | tests/conftest.py | 9 | ||||
-rw-r--r-- | tox.ini | 4 |
4 files changed, 10 insertions, 7 deletions
diff --git a/.ci/appveyor.yml b/.ci/appveyor.yml index d4135e0..eb9ba86 100644 --- a/.ci/appveyor.yml +++ b/.ci/appveyor.yml @@ -27,7 +27,7 @@ install: - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" # Build data files - - "pip install --upgrade pytest==3.3.2 pytest-cov==2.5.1 codecov freezegun==0.3.11" + - "pip install --upgrade pytest==4.3.1 pytest-cov==2.6.1 codecov freezegun==0.3.11" - "pip install --editable ." - "python setup.py import_cldr" diff --git a/.travis.yml b/.travis.yml index c9c0a9b..9fad4fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ matrix: install: - bash .ci/deps.${TRAVIS_OS_NAME}.sh - pip install --upgrade pip - - pip install --upgrade $CDECIMAL pytest==3.3.2 pytest-cov==2.5.1 freezegun==0.3.11 + - pip install --upgrade $CDECIMAL pytest==4.3.1 pytest-cov==2.6.1 freezegun==0.3.11 - pip install --editable . script: diff --git a/tests/conftest.py b/tests/conftest.py index be93b2b..5b14b1c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,9 @@ def os_environ(monkeypatch): def pytest_generate_tests(metafunc): - if hasattr(metafunc.function, "all_locales"): - from babel.localedata import locale_identifiers - metafunc.parametrize("locale", list(locale_identifiers())) + if hasattr(metafunc.function, "pytestmark"): + for mark in metafunc.function.pytestmark: + if mark.name == "all_locales": + from babel.localedata import locale_identifiers + metafunc.parametrize("locale", list(locale_identifiers())) + break @@ -3,8 +3,8 @@ envlist = py27, pypy, py34, py35, py36, py37, pypy3, py27-cdecimal [testenv] deps = - pytest==3.3.2 - pytest-cov==2.5.1 + pytest==4.3.1 + pytest-cov==2.6.1 cdecimal: m3-cdecimal freezegun==0.3.11 whitelist_externals = make |