mirror of
https://github.com/jbowdre/phpIPAM-for-vRA8.git
synced 2024-11-29 18:32:18 +00:00
23 lines
571 B
Python
23 lines
571 B
Python
import pytest
|
|
|
|
from . import contexts
|
|
|
|
|
|
@pytest.fixture
|
|
def user_override(monkeypatch):
|
|
"""
|
|
Override site.USER_BASE and site.USER_SITE with temporary directories in
|
|
a context.
|
|
"""
|
|
with contexts.tempdir() as user_base:
|
|
monkeypatch.setattr('site.USER_BASE', user_base)
|
|
with contexts.tempdir() as user_site:
|
|
monkeypatch.setattr('site.USER_SITE', user_site)
|
|
with contexts.save_user_site_setting():
|
|
yield
|
|
|
|
|
|
@pytest.fixture
|
|
def tmpdir_cwd(tmpdir):
|
|
with tmpdir.as_cwd() as orig:
|
|
yield orig
|