Skip to content

Commit

Permalink
Update test setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
thefunny42 committed Jan 12, 2016
1 parent e9b3aac commit 8a2e641
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
8 changes: 3 additions & 5 deletions src/grokcore/catalog/ftests/test_grok_functional.py
@@ -1,11 +1,9 @@
# -*- coding: utf-8 -*-

import doctest
import unittest
import grokcore.catalog

from pkg_resources import resource_listdir
from zope.testing import doctest

from zope.app.appsetup.testlayer import ZODBLayer
import grokcore.catalog


FunctionalLayer = ZODBLayer(grokcore.catalog)
Expand Down
28 changes: 14 additions & 14 deletions src/grokcore/catalog/tests/test_grok.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-

import doctest
import re
import unittest
import zope.component.eventtesting

from pkg_resources import resource_listdir
from zope.testing import doctest, cleanup, renormalizing

from zope.testing import cleanup, renormalizing
import zope.component.eventtesting


def setUpZope(test):
Expand All @@ -20,9 +19,9 @@ def cleanUpZope(test):
# str(Exception) has changed from Python 2.4 to 2.5 (due to
# Exception now being a new-style class). This changes the way
# exceptions appear in traceback printouts.
(re.compile(r"ConfigurationExecutionError: <class '([\w.]+)'>:"),
r'ConfigurationExecutionError: \1:'),
])
(re.compile(
r"ConfigurationExecutionError: <class '([\w.]+)'>:"),
r'ConfigurationExecutionError: \1:')])


def suiteFromPackage(name):
Expand All @@ -37,16 +36,17 @@ def suiteFromPackage(name):
continue

dottedname = 'grokcore.catalog.tests.%s.%s' % (name, filename[:-3])
test = doctest.DocTestSuite(dottedname,
setUp=setUpZope,
tearDown=cleanUpZope,
checker=checker,
optionflags=doctest.ELLIPSIS+
doctest.NORMALIZE_WHITESPACE)
test = doctest.DocTestSuite(
dottedname,
setUp=setUpZope,
tearDown=cleanUpZope,
checker=checker,
optionflags=doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE)

suite.addTest(test)
return suite


def test_suite():
suite = unittest.TestSuite()
for name in ['catalog']:
Expand Down

0 comments on commit 8a2e641

Please sign in to comment.