conservancy_beancount/tests/conftest.py

20 lines
694 B
Python
Raw Normal View History

import os
import pytest
from . import testutil
@pytest.fixture(scope='session', autouse=True)
def clean_environment(tmpdir_factory):
2020-04-13 02:24:34 +00:00
config_path_s = str(testutil.test_path('userconfig'))
for key in ['LANG', 'LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LC_MONETARY']:
os.environ[key] = 'en_US.UTF-8'
os.environ.pop('RTAUTH', None)
os.environ.pop('RTPASSWD', None)
os.environ.pop('RTSERVER', None)
os.environ.pop('RTUSER', None)
os.environ['CONSERVANCY_REPOSITORY'] = str(testutil.test_path('repository'))
2020-04-13 02:24:34 +00:00
os.environ['HOME'] = config_path_s
os.environ['XDG_CACHE_HOME'] = str(tmpdir_factory.mktemp('.cache'))
2020-04-13 02:24:34 +00:00
os.environ['XDG_CONFIG_HOME'] = config_path_s