Changeset - eaae2b4a44ce
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2020-05-28 19:52:09
brettcsmith@brettcsmith.org
tests: Set locale environment variables.

To help tests get consistent formatting of currency.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
tests/conftest.py
Show inline comments
...
 
@@ -2,16 +2,18 @@ import os
 

	
 
import pytest
 

	
 
from . import testutil
 

	
 
@pytest.fixture(scope='session', autouse=True)
 
def clean_environment(tmpdir_factory):
 
    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'))
 
    os.environ['HOME'] = config_path_s
 
    os.environ['XDG_CACHE_HOME'] = str(tmpdir_factory.mktemp('.cache'))
 
    os.environ['XDG_CONFIG_HOME'] = config_path_s
0 comments (0 inline, 0 general)