Skip to content

Commit

Permalink
make doctest files rst
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Sep 14, 2018
1 parent 6ff2790 commit e8100ea
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions Products/CMFEditions/tests/test_doctests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from plone.testing import layered
from Products.CMFEditions.testing import PRODUCTS_CMFEDITIONS_FUNCTIONAL_TESTING
from Products.CMFEditions.testing import PRODUCTS_CMFEDITIONS_FUNCTIONAL_TESTING # noqa

import doctest
import six
Expand All @@ -24,15 +24,26 @@ def __init__(self, obid):
self.id = obid
self.__annotations__ = {}

OPTIONFLAGS = (doctest.ELLIPSIS |
doctest.NORMALIZE_WHITESPACE |
doctest.REPORT_ONLY_FIRST_FAILURE)

OPTIONFLAGS = (
doctest.ELLIPSIS |
doctest.NORMALIZE_WHITESPACE |
doctest.REPORT_ONLY_FIRST_FAILURE
)


def test_suite():
suite = unittest.TestSuite()
if six.PY2:
suite.addTest(layered(doctest.DocFileSuite('webdav_history.txt',
optionflags=OPTIONFLAGS,
package='Products.CMFEditions.tests',),
layer=PRODUCTS_CMFEDITIONS_FUNCTIONAL_TESTING))
suite.addTest(doctest.DocFileSuite('large_file_modifiers.txt'))
suite.addTest(
layered(
doctest.DocFileSuite(
'webdav_history.rst',
optionflags=OPTIONFLAGS,
package='Products.CMFEditions.tests',
),
layer=PRODUCTS_CMFEDITIONS_FUNCTIONAL_TESTING,
)
)
suite.addTest(doctest.DocFileSuite('large_file_modifiers.rst'))
return suite

0 comments on commit e8100ea

Please sign in to comment.