diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 58b77e5..a6c7e6e 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -4,7 +4,11 @@ Changelog 1.1.2 (unreleased) ------------------ -- Nothing changed yet. +- Fix test isolation problem. + [thet] + +- Replace deprecated ``zope.testing.doctest`` import with ``doctest`` module from stdlib. + [thet] 1.1.1 (2015-03-21) diff --git a/plone/rfc822/tests.py b/plone/rfc822/tests.py index 62f442a..3679ca6 100644 --- a/plone/rfc822/tests.py +++ b/plone/rfc822/tests.py @@ -1,23 +1,29 @@ import unittest -from zope.testing import doctest -import zope.component.testing +import doctest +from plone.testing import layered +from plone.testing.zca import UNIT_TESTING + + +DOCFILES = [ + 'message.txt', + 'fields.txt', + 'supermodel.txt', +] + +optionflags = doctest.ELLIPSIS + def test_suite(): - return unittest.TestSuite(( - doctest.DocFileSuite( - 'message.txt', - tearDown=zope.component.testing.tearDown(), - optionflags=doctest.ELLIPSIS - ), - doctest.DocFileSuite( - 'fields.txt', - tearDown=zope.component.testing.tearDown(), - optionflags=doctest.ELLIPSIS - ), + suite = unittest.TestSuite() + suite.addTests([ + layered( doctest.DocFileSuite( - 'supermodel.txt', - tearDown=zope.component.testing.tearDown(), - optionflags=doctest.ELLIPSIS + docfile, + optionflags=optionflags, ), - )) + layer=UNIT_TESTING + ) + for docfile in DOCFILES + ]) + return suite diff --git a/setup.py b/setup.py index 7390cb1..ff34541 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ zip_safe=False, extras_require={ 'supermodel': ['plone.supermodel'], + 'test': ['plone.testing'], }, install_requires=[ 'setuptools',