diff options
| author | Barry Warsaw | 2007-11-18 16:38:59 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2007-11-18 16:38:59 -0500 |
| commit | eff07b15bedb17e51271a75f849447100b201734 (patch) | |
| tree | c429a9e854007a64ad8373f97295f66a1ac190c7 /Mailman/tests/test_documentation.py | |
| parent | 2b7304d722e9ca628d6550dbb024dfa78322e91f (diff) | |
| parent | 8a7be9204a9170f9d9b0eb79c2726df0c7a1b4a9 (diff) | |
| download | mailman-eff07b15bedb17e51271a75f849447100b201734.tar.gz mailman-eff07b15bedb17e51271a75f849447100b201734.tar.zst mailman-eff07b15bedb17e51271a75f849447100b201734.zip | |
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 |
