Last active
January 27, 2016 22:43
-
-
Save dmerejkowsky/27939a4cd8de4ff5b902 to your computer and use it in GitHub Desktop.
Using py.test fixtures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in qisys.sh | |
def get_config_path(): | |
return get_path(".config") | |
def get_share_path(): | |
return get_path(".local/share") | |
def get_path(): | |
# read XDG | |
# mkdir | |
# return full path | |
# in qisys.test.conftest | |
def fake_get_path(*args): | |
""" Return a path in ``tmpdir`` """ | |
... | |
@pytest.fixture(autouse=True) | |
def tmpfiles(request, tmpdir): | |
mock.patch("qisys.sh.get_path", fake_get_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment