summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:00 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:00 -0500
commit3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (patch)
treea7cf56282e54f05785243bc1e903d6594f2c06ba /tests/conftest.py
parent787b97a4cb24330b36f11297c6d3a7a473a907d0 (diff)
New upstream version 8.1.2.upstream/8.1.2
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index fbb09c8..56fe8bd 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,8 +1,24 @@
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")