diff options
Diffstat (limited to 'Mailman/tests/test_documentation.py')
| -rw-r--r-- | Mailman/tests/test_documentation.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Mailman/tests/test_documentation.py b/Mailman/tests/test_documentation.py index d8578bd05..575d8e6bd 100644 --- a/Mailman/tests/test_documentation.py +++ b/Mailman/tests/test_documentation.py @@ -22,22 +22,34 @@ import pdb import doctest import unittest +from email import message_from_string + import Mailman +from Mailman.Message import Message from Mailman.app.styles import style_manager from Mailman.configuration import config -from Mailman.database import flush COMMASPACE = ', ' +def specialized_message_from_string(text): + return message_from_string(text, Message) + + +def setup(testobj): + """Set up some things for convenience.""" + testobj.globs['config'] = config + testobj.globs['message_from_string'] = specialized_message_from_string + + + def cleaning_teardown(testobj): """Clear all persistent data at the end of a doctest.""" # Clear the database of all rows. config.db._reset() - flush() # Remove all but the default style. for style in style_manager.styles: if style.name <> 'default': @@ -69,6 +81,7 @@ def test_suite(): 'docs/' + filename, package=Mailman, optionflags=flags, + setUp=setup, tearDown=cleaning_teardown) suite.addTest(test) return suite |
