Skip to content
Snippets Groups Projects
Commit fd6f5808 authored by ulif's avatar ulif
Browse files

Add test fixture for temporary home dir.

parent c6f594ab
Branches
Tags
No related merge requests found
......@@ -21,3 +21,12 @@ def wordlists_dir(request, monkeypatch, tmpdir):
"""
monkeypatch.setattr("diceware.wordlist.WORDLISTS_DIR", str(tmpdir))
return tmpdir
@pytest.fixture(scope="function")
def home_dir(request, monkeypatch, tmpdir):
"""This fixture provides a temporary user home.
"""
tmpdir.mkdir("home")
monkeypatch.setenv("HOME", str(tmpdir / "home"))
return tmpdir / "home"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment