Files @ c6dc2d83aca7
Branch filter:

Location: NPO-Accounting/conservancy_beancount/tests/conftest.py

Brett Smith
data.Amount: Introduce class and simplify code to use it.

See docstring for full rationale. This greatly reduces the need for other
plugin code to handle the case of `post.units.number is None`, eliminating
the need for entire methods and letting it do plain numeric comparisons.
import os

import pytest

from . import testutil

@pytest.fixture(scope='session', autouse=True)
def clean_environment(tmpdir_factory):
    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'))
    os.environ['HOME'] = str(testutil.test_path('userconfig'))
    os.environ['XDG_CACHE_DIR'] = str(tmpdir_factory.mktemp('.cache'))