From e3d6c34b7d02b925cb8c59fa9e1df24741fc46ee Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 1 Jan 2017 17:25:29 -0500 Subject: Implement caching suffix list with in-tree fallback. Also: * Change doctest cleanups to be an ExitStack. * Added [dmarc]cache_lifetime setting. * Cleanup pass through dmarc-mitigation.rst. * Be sure the cached org domain file is cleaned up when the world is reset. --- src/mailman/testing/documentation.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/mailman/testing/documentation.py') diff --git a/src/mailman/testing/documentation.py b/src/mailman/testing/documentation.py index 97e30e900..8670f05ef 100644 --- a/src/mailman/testing/documentation.py +++ b/src/mailman/testing/documentation.py @@ -21,7 +21,7 @@ Note that doctest extraction does not currently work for zip file distributions. doctest discovery currently requires file system traversal. """ -from inspect import isfunction, ismethod +from contextlib import ExitStack from mailman.app.lifecycle import create_list from mailman.config import config from mailman.testing.helpers import ( @@ -153,13 +153,9 @@ def setup(testobj): testobj.globs['subscribe'] = subscribe testobj.globs['transaction'] = config.db # Add this so that cleanups can be automatically added by the doctest. - testobj.globs['cleanups'] = [] + testobj.globs['cleanups'] = ExitStack() @public def teardown(testobj): - for cleanup in testobj.globs['cleanups']: - if isfunction(cleanup) or ismethod(cleanup): - cleanup() - else: - cleanup[0](*cleanup[1:]) + testobj.globs['cleanups'].close() -- cgit v1.2.3-70-g09d2