Skip to content

Commit

Permalink
Merge pull request #3 from gyst/master
Browse files Browse the repository at this point in the history
Remove outdated exception handling from tests
  • Loading branch information
janwijbrand authored Feb 21, 2018
2 parents 234c421 + 6666bae commit 93ce50a
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/grokcore/viewlet/tests/test_functional.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
##############################################################################
#
# Copyright (c) 2006-2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

import re
import unittest
import doctest
import grokcore.viewlet
import zope.testbrowser.wsgi
import zope.app.wsgi.testlayer

from pkg_resources import resource_listdir
from zope.testing import renormalizing


class Layer(
Expand All @@ -31,12 +15,6 @@ class Layer(
layer = Layer(grokcore.viewlet, allowTearDown=True)


checker = renormalizing.RENormalizing([
# Accommodate to exception wrapping in newer versions of mechanize
(re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
])


def suiteFromPackage(name):
layer_dir = 'functional'
files = resource_listdir(__name__, '{}/{}'.format(layer_dir, name))
Expand All @@ -51,13 +29,12 @@ def suiteFromPackage(name):
layer_dir, name, filename[:-3])
test = doctest.DocTestSuite(
dottedname,
checker=checker,
extraglobs=dict(getRootFolder=layer.getRootFolder,),
optionflags=(
doctest.ELLIPSIS +
doctest.NORMALIZE_WHITESPACE +
doctest.REPORT_NDIFF +
renormalizing.IGNORE_EXCEPTION_MODULE_IN_PYTHON2))
doctest.IGNORE_EXCEPTION_DETAIL))
test.layer = layer

suite.addTest(test)
Expand Down

0 comments on commit 93ce50a

Please sign in to comment.