summaryrefslogtreecommitdiffstats
path: root/conftest.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-12-12 11:57:01 +0100
committerDaniel Baumann <daniel@debian.org>2024-12-12 11:57:01 +0100
commit8e29081b9d01c2e1177adb00224cc04ee4dd7642 (patch)
treec6b8ad3aab9eacab43fa63160cfbdf2adc1371b5 /conftest.py
parentInitial commit. (diff)
downloadablog-8e29081b9d01c2e1177adb00224cc04ee4dd7642.tar.xz
ablog-8e29081b9d01c2e1177adb00224cc04ee4dd7642.zip
Adding upstream version 0.11.12.upstream/0.11.12upstream
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 0000000..8a58b65
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,30 @@
+from pathlib import Path
+
+import docutils
+import pytest
+import sphinx
+
+# Load app, status and warning fixtures.
+pytest_plugins = ["sphinx.testing.fixtures"]
+
+
+# inspired from sphinx's conftest.py
+def pytest_report_header(config):
+ header = f"libraries: Sphinx-{sphinx.__display_version__}, docutils-{docutils.__version__}"
+ if hasattr(config, "_tmp_path_factory"):
+ header += f"\nbase tempdir: {config._tmp_path_factory.getbasetemp()}"
+
+ return header
+
+
+@pytest.fixture(scope="session")
+def rootdir():
+ return Path(__file__).parent.absolute() / "roots"
+
+
+@pytest.fixture(scope="function", autouse=True)
+def reset_blog_config():
+ # Reset cached configurations to enable confoverrides
+ from ablog.blog import Blog
+
+ Blog._dict = {}