diff options
Diffstat (limited to 'src/mailman/tests/test_configfile.py')
| -rw-r--r-- | src/mailman/tests/test_configfile.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/mailman/tests/test_configfile.py b/src/mailman/tests/test_configfile.py index 2d418bb54..9406d9ca2 100644 --- a/src/mailman/tests/test_configfile.py +++ b/src/mailman/tests/test_configfile.py @@ -25,6 +25,7 @@ import unittest from contextlib import contextmanager from mailman.core.initialize import search_for_configuration_file +from mailman.testing.helpers import hackenv # Here are a couple of context managers that make our tests easier to read. @@ -39,20 +40,6 @@ def fakedirs(path): @contextmanager -def hackenv(envar, new_value): - """Hack the environment temporarily, then reset it.""" - old_value = os.getenv(envar) - os.environ[envar] = new_value - try: - yield - finally: - if old_value is None: - del os.environ[envar] - else: - os.environ[envar] = old_value - - -@contextmanager def chdir(new_cwd): """Change to the directory, then back again.""" old_cwd = os.getcwd() |
