File: conftest.py

package info (click to toggle)
python-babel 2.6.0%2Bdfsg.1-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 164,640 kB
  • sloc: xml: 1,848,178; python: 11,849; makefile: 213; sh: 44
file content (15 lines) | stat: -rw-r--r-- 396 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
import pytest


@pytest.fixture
def os_environ(monkeypatch):
    mock_environ = dict(os.environ)
    monkeypatch.setattr(os, 'environ', mock_environ)
    return mock_environ


def pytest_generate_tests(metafunc):
    if hasattr(metafunc.function, "all_locales"):
        from babel.localedata import locale_identifiers
        metafunc.parametrize("locale", list(locale_identifiers()))