-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
# -*- coding: UTF-8 -*- | ||
from zope.component.testing import setUp, tearDown | ||
|
||
import doctest | ||
import re | ||
import six | ||
import unittest | ||
|
||
from zope.component.testing import setUp, tearDown | ||
import doctest | ||
|
||
class Py23DocChecker(doctest.OutputChecker): | ||
def check_output(self, want, got, optionflags): | ||
if six.PY2: | ||
got = re.sub("u'(.*?)'", "'\\1'", got) | ||
return doctest.OutputChecker.check_output(self, want, got, optionflags) | ||
|
||
|
||
def test_suite(): | ||
return unittest.TestSuite(( | ||
doctest.DocTestSuite('plone.app.i18n.locales.browser.selector', | ||
setUp=setUp(), | ||
tearDown=tearDown, | ||
optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE), | ||
doctest.DocTestSuite( | ||
'plone.app.i18n.locales.browser.selector', | ||
setUp=setUp(), | ||
tearDown=tearDown, | ||
optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE, | ||
checker=Py23DocChecker(), | ||
) | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
# -*- coding: UTF-8 -*- | ||
from plone.app.testing import PLONE_INTEGRATION_TESTING | ||
from plone.testing import layered | ||
|
||
import unittest | ||
import doctest | ||
|
||
from plone.app.testing.bbb import PTC_FUNCTIONAL_TESTING | ||
from plone.testing import layered | ||
import re | ||
import six | ||
import unittest | ||
|
||
OPTIONFLAGS = (doctest.REPORT_ONLY_FIRST_FAILURE | | ||
doctest.ELLIPSIS | | ||
doctest.NORMALIZE_WHITESPACE) | ||
|
||
|
||
class Py23DocChecker(doctest.OutputChecker): | ||
def check_output(self, want, got, optionflags): | ||
if six.PY2: | ||
got = re.sub("u'(.*?)'", "'\\1'", got) | ||
return doctest.OutputChecker.check_output(self, want, got, optionflags) | ||
|
||
|
||
def test_suite(): | ||
return unittest.TestSuite(( | ||
doctest.DocTestSuite('plone.app.i18n.locales.countries'), | ||
doctest.DocTestSuite('plone.app.i18n.locales.languages'), | ||
layered(doctest.DocFileSuite('countries.txt', | ||
optionflags=OPTIONFLAGS, | ||
package='plone.app.i18n.locales.tests', | ||
), layer=PTC_FUNCTIONAL_TESTING), | ||
checker=Py23DocChecker(), | ||
), layer=PLONE_INTEGRATION_TESTING), | ||
layered(doctest.DocFileSuite('languages.txt', | ||
optionflags=OPTIONFLAGS, | ||
package='plone.app.i18n.locales.tests', | ||
), layer=PTC_FUNCTIONAL_TESTING) | ||
checker=Py23DocChecker(), | ||
), layer=PLONE_INTEGRATION_TESTING) | ||
)) |