Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conftest.py compatibility with pytest 4.3 #635

Merged
merged 2 commits into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down