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 dc8f0af commit 71b9e3d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/grokcore/security/ftests/test_all.py
@@ -1,5 +1,5 @@
import re
import doctest
import re
import unittest
import grokcore.security

Expand All @@ -14,6 +14,7 @@
(re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
])


def suiteFromPackage(name):
files = resource_listdir(__name__, name)
suite = unittest.TestSuite()
Expand All @@ -37,11 +38,11 @@ def suiteFromPackage(name):
suite.addTest(test)
return suite


def test_suite():
suite = unittest.TestSuite()
for name in [
'role'
]:
'role']:
suite.addTest(suiteFromPackage(name))
return suite

Expand Down
20 changes: 11 additions & 9 deletions src/grokcore/security/tests/test_all.py
@@ -1,7 +1,10 @@
import doctest
import re
import unittest
from pkg_resources import resource_listdir
from zope.testing import doctest, cleanup, renormalizing

from zope.testing import cleanup, renormalizing


def cleanUpZope(test):
cleanup.cleanUp()
Expand All @@ -12,8 +15,8 @@ def cleanUpZope(test):
# exceptions appear in traceback printouts.
(re.compile(
r"ConfigurationExecutionError: <class '([\w.]+)'>:"),
r'ConfigurationExecutionError: \1:'),
])
r'ConfigurationExecutionError: \1:')])


def suiteFromPackage(name):
files = resource_listdir(__name__, name)
Expand All @@ -30,18 +33,17 @@ def suiteFromPackage(name):
dottedname,
tearDown=cleanUpZope,
checker=checker,
optionflags=doctest.ELLIPSIS+
doctest.NORMALIZE_WHITESPACE)
optionflags=doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE)
suite.addTest(test)
return suite


def test_suite():
suite = unittest.TestSuite()
for name in [
'permissions',
'role',
'security',
]:
'permissions',
'role',
'security']:
suite.addTest(suiteFromPackage(name))
return suite

Expand Down

0 comments on commit 71b9e3d

Please sign in to comment.