summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMiro Hrončok <miro@hroncok.cz>2019-03-14 19:54:42 +0100
committerMiro Hrončok <miro@hroncok.cz>2019-03-14 19:54:42 +0100
commitb33c95530b0d5e717fd36f5b775137c83c3bcf67 (patch)
tree8552dc6dfdc8ca1d2c59b040914c2fe941c7ac0a /tests
parent69cda1d2082444ed99836d92135f175d20555463 (diff)
downloadbabel-b33c95530b0d5e717fd36f5b775137c83c3bcf67.tar.gz
Fix conftest.py compatibility with pytest 4.3
While pytest in tox.ini is explicitly set to be 3.3.2, in Fedora 31 we are about to update to a newer version of pytest. In order to be able to test babel, we need pytest 4.3 support. This adds support for pytest 4.3 without breaking support for 3.3.2.
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py9
1 files changed, 6 insertions, 3 deletions
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