diff options
| author | Mark Sapiro | 2017-01-01 22:05:49 -0800 |
|---|---|---|
| committer | Mark Sapiro | 2017-01-01 22:05:49 -0800 |
| commit | f9cf79290eb7a22c4d52622dbef50367a086234d (patch) | |
| tree | 398ac7db49d11e3c11b15283da09edb1ab4fe661 /src/mailman/testing/documentation.py | |
| parent | d233dd419fabd4b42d5b83b920ec7ee54fee57da (diff) | |
| parent | e3d6c34b7d02b925cb8c59fa9e1df24741fc46ee (diff) | |
| download | mailman-f9cf79290eb7a22c4d52622dbef50367a086234d.tar.gz mailman-f9cf79290eb7a22c4d52622dbef50367a086234d.tar.zst mailman-f9cf79290eb7a22c4d52622dbef50367a086234d.zip | |
Merge branch 'mr215-review' of gitlab.com:warsaw/mailman into dmarc and
resolve conflicts.
Diffstat (limited to 'src/mailman/testing/documentation.py')
| -rw-r--r-- | src/mailman/testing/documentation.py | 10 |
1 files changed, 3 insertions, 7 deletions
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() |
