diff options
| author | Barry Warsaw | 2007-06-21 19:46:27 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-06-21 19:46:27 -0400 |
| commit | 3ced6a5996caca7b46bc68876d86a094bde9b374 (patch) | |
| tree | 17ef25b5a86793d96f54738cfc8b2aa87437b83d /Mailman/testing/test_avoid_duplicates.py | |
| parent | 6c1ccc236bc24d8b3bb04807ba4b24e8a7a0d18e (diff) | |
| download | mailman-3ced6a5996caca7b46bc68876d86a094bde9b374.tar.gz mailman-3ced6a5996caca7b46bc68876d86a094bde9b374.tar.zst mailman-3ced6a5996caca7b46bc68876d86a094bde9b374.zip | |
Convert the AvoidDuplicates handler tests to a doctest. Well,
actually there /was/ no separate AvoidDuplicates test, but now there
is, even though it may not be full coverage.
Update the AvoidDuplicates handler to use more modern Python idioms.
Diffstat (limited to 'Mailman/testing/test_avoid_duplicates.py')
| -rw-r--r-- | Mailman/testing/test_avoid_duplicates.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Mailman/testing/test_avoid_duplicates.py b/Mailman/testing/test_avoid_duplicates.py new file mode 100644 index 000000000..96599f1ed --- /dev/null +++ b/Mailman/testing/test_avoid_duplicates.py @@ -0,0 +1,33 @@ +# Copyright (C) 2007 by the Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +"""Doctest harness for the AvoidDuplicates handler.""" + +import os +import doctest +import unittest + +options = (doctest.ELLIPSIS + | doctest.NORMALIZE_WHITESPACE + | doctest.REPORT_NDIFF) + + +def test_suite(): + suite = unittest.TestSuite() + suite.addTest(doctest.DocFileSuite('../docs/avoid-duplicates.txt', + optionflags=options)) + return suite |
