Skip to content

Commit

Permalink
Fix TestConfig unit tests by removing other possible environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
bboe committed Jul 30, 2016
1 parent 7caf9cd commit 092a076
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/test_config.py
Expand Up @@ -13,6 +13,11 @@ def _assert_config_read(environment, mock_config):
mock_instance = mock_config.return_value
Config.CONFIG = None # Force config file reload
prev_environment = os.environ.get(environment)
for to_remove in ['APPDATA', 'HOME', 'XDG_CONFIG_HOME']:
try:
del os.environ[to_remove]
except KeyError:
pass
os.environ[environment] = '/MOCK'

module_dir = os.path.dirname(sys.modules['praw'].__file__)
Expand Down

0 comments on commit 092a076

Please sign in to comment.