summaryrefslogtreecommitdiff
path: root/src/mailman/tests/test_configfile.py
diff options
context:
space:
mode:
authorBarry Warsaw2016-04-08 22:45:36 -0400
committerBarry Warsaw2016-04-08 22:45:36 -0400
commitb0b36f18f86be2c8a8a443bf425ad4114c53c06e (patch)
treeff34562b3f050c8dc4ccd3c82153d667248e2829 /src/mailman/tests/test_configfile.py
parent29da358eb0c92ba94d417736927060411c4264f8 (diff)
downloadmailman-b0b36f18f86be2c8a8a443bf425ad4114c53c06e.tar.gz
mailman-b0b36f18f86be2c8a8a443bf425ad4114c53c06e.tar.zst
mailman-b0b36f18f86be2c8a8a443bf425ad4114c53c06e.zip
Diffstat (limited to 'src/mailman/tests/test_configfile.py')
-rw-r--r--src/mailman/tests/test_configfile.py15
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()