aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:50 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:50 -0500
commit475d074fd74425efbe783fad08f97f2df0c4909f (patch)
tree2acdae53999b3c74b716efa4edb5b40311fa356a /tests/conftest.py
parentcd502d52787f666fff3254d7d7e7578930c813c2 (diff)
parent3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (diff)
Update upstream source from tag 'upstream/8.1.2'
Update to upstream version '8.1.2' with Debian dir e5e966a9e6010ef70618dc9a61558fa4db35aceb
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 68309d5..56fe8bd 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,8 +2,23 @@ import os
import pytest
-@pytest.yield_fixture(autouse=True)
+@pytest.fixture(autouse=True)
def ensure_chdir():
- x = os.getcwd()
- yield
- os.chdir(x)
+ old_dir = os.getcwd()
+ try:
+ yield
+ finally:
+ os.chdir(old_dir)
+
+
+@pytest.fixture(scope="module")
+def test_dir():
+ """
+ Absolute path to the directory with the tests.
+ """
+ return os.path.abspath(os.path.dirname(__file__))
+
+
+@pytest.fixture(scope="session")
+def default_locale() -> str:
+ return os.environ.get("NIKOLA_LOCALE_DEFAULT", "en")