Skip to content

Commit

Permalink
Bring coverage back to 100 %
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jun 17, 2019
1 parent dcdda5f commit b5c4fa2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Expand Up @@ -9,3 +9,4 @@ exclude_lines =
raise NotImplementedError
self.fail
raise AssertionError
class I[A-Z]\w+\(Interface\):
3 changes: 2 additions & 1 deletion src/zope/browserpage/metaconfigure.py
Expand Up @@ -426,7 +426,8 @@ def browserDefault(self, request):

attr = self.__page_attribute__
if attr == 'browserDefault':
raise AttributeError("browserDefault")
# safety guard against recursion error:
raise AttributeError("browserDefault") # pragma: no cover

meth = getattr(self, attr)
return (meth, "")
Expand Down
8 changes: 5 additions & 3 deletions src/zope/browserpage/tests/test_metaconfigure.py
Expand Up @@ -42,7 +42,8 @@ def action(self, **kwargs):
class _AbstractHandlerTest(unittest.TestCase):

if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
# PY2:
assertRaisesRegex = unittest.TestCase.assertRaisesRegexp # pragma: no cover

def setUp(self):
self.context = Context()
Expand Down Expand Up @@ -95,7 +96,8 @@ def browserDefault(self):
def test_class_with_allowed_attributes(self):
class BrowserDefault(object):
def foo(self):
return "bar"
raise AssertionError("foo called")

def browserDefault(self):
raise AssertionError("Not called")
context = self._call(
Expand All @@ -111,7 +113,7 @@ def browserDefault(self):
def test_class_with_allowed_interface(self):
class BrowserDefault(object):
def foo(self):
return "bar"
raise AssertionError("foo called")
def browserDefault(self):
raise AssertionError("Not called")
class IFoo(Interface):
Expand Down

0 comments on commit b5c4fa2

Please sign in to comment.