diff options
| -rw-r--r-- | tests/conftest.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 5fccfc0..8b1fea9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,12 +17,25 @@ """Define fixtures used across all tests in this folder.""" +from os import chdir +from pathlib import Path + import pytest import requests_mock as rm from wikiget.file import File +@pytest.fixture(autouse=True) +def _chdir_to_tmp_dir(tmp_path: Path) -> None: + """Change to a temporary directory before running tests. + + :param tmp_path: temporary path object + :type tmp_path: Path + """ + chdir(tmp_path) + + @pytest.fixture() def file_with_name() -> File: """Create a test File with only a filename. |
