summaryrefslogtreecommitdiff
path: root/src/mailman/tests/test_documentation.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/tests/test_documentation.py')
-rw-r--r--src/mailman/tests/test_documentation.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mailman/tests/test_documentation.py b/src/mailman/tests/test_documentation.py
index f459f3a92..a2c1ab592 100644
--- a/src/mailman/tests/test_documentation.py
+++ b/src/mailman/tests/test_documentation.py
@@ -178,6 +178,14 @@ def setup(testobj):
testobj.globs['smtpd'] = SMTPLayer.smtpd
testobj.globs['stop'] = stop
testobj.globs['transaction'] = config.db
+ # Add this so that cleanups can be automatically added by the doctest.
+ testobj.globs['cleanups'] = []
+
+
+
+def teardown(testobj):
+ for cleanup in testobj.globs['cleanups']:
+ cleanup()
@@ -223,7 +231,8 @@ def test_suite():
path,
package='mailman',
optionflags=flags,
- setUp=setup)
+ setUp=setup,
+ tearDown=teardown)
test.layer = layer
suite.addTest(test)
return suite