summaryrefslogtreecommitdiff
path: root/src/mailman/testing/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-01-01 17:25:29 -0500
committerBarry Warsaw2017-01-01 17:28:37 -0500
commite3d6c34b7d02b925cb8c59fa9e1df24741fc46ee (patch)
treee6e27c9dec4557dc46c4b8ffd99bf556da4ed4ed /src/mailman/testing/helpers.py
parentc786a77c3b82932facd63fabe3144f9099f1ea51 (diff)
downloadmailman-e3d6c34b7d02b925cb8c59fa9e1df24741fc46ee.tar.gz
mailman-e3d6c34b7d02b925cb8c59fa9e1df24741fc46ee.tar.zst
mailman-e3d6c34b7d02b925cb8c59fa9e1df24741fc46ee.zip
Diffstat (limited to 'src/mailman/testing/helpers.py')
-rw-r--r--src/mailman/testing/helpers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index 233b03cf8..290f7e026 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -245,7 +245,7 @@ def get_nntp_server(cleanups):
"""
patcher = mock.patch('nntplib.NNTP')
server_class = patcher.start()
- cleanups.append(patcher.stop)
+ cleanups.callback(patcher.stop)
nntpd = server_class()
# A class for more convenient access to the posted message.
class NNTPProxy: # noqa: E306
@@ -480,6 +480,11 @@ def reset_the_world():
getUtility(IStyleManager).populate()
# Remove all dynamic header-match rules.
config.chains['header-match'].flush()
+ # Remove cached organizational domain suffix file.
+ from mailman.rules.dmarc import LOCAL_FILE_NAME
+ suffix_file = os.path.join(config.VAR_DIR, LOCAL_FILE_NAME)
+ with suppress(FileNotFoundError):
+ os.remove(suffix_file)
@public