From 27b917e9e5122a388c251b982608972908844167 Mon Sep 17 00:00:00 2001 From: Delirious Lettuce Date: Sat, 8 Jul 2017 00:17:20 -0600 Subject: [PATCH] Add locale fixtures --- test/conftest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/conftest.py b/test/conftest.py index 147c7e99..a5f95c11 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -83,6 +83,26 @@ def default_zw(): shutil.rmtree(tmp_dir) +@pytest.fixture +def locale_en(monkeypatch): + monkeypatch.setattr('locale.getdefaultlocale', lambda: ('en_US', 'UTF-8')) + + +@pytest.fixture +def locale_fr(monkeypatch): + monkeypatch.setattr('locale.getdefaultlocale', lambda: ('fr_FR', 'UTF-8')) + + +@pytest.fixture +def locale_invalid(monkeypatch): + monkeypatch.setattr('locale.getdefaultlocale', lambda: ('xx_XX', 'UTF-8')) + + +@pytest.fixture +def locale_ru(monkeypatch): + monkeypatch.setattr('locale.getdefaultlocale', lambda: ('ru_RU', 'UTF-8')) + + @pytest.fixture def platform_darwin(monkeypatch): monkeypatch.setattr('platform.system', lambda: 'Darwin')