Skip to content

Commit

Permalink
Adjust coverage config for py2 only tests; fix typo; finish replacing…
Browse files Browse the repository at this point in the history
… self with cls
  • Loading branch information
jamadden committed Jun 12, 2017
1 parent b752e80 commit bc0b2a9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ exclude_lines =
class I[A-Z]\w+\((Interface|I[A-Z].*)\):
raise NotImplementedError
self\.fail
@_skip_under_py2
6 changes: 3 additions & 3 deletions src/zope/interface/tests/test_advice.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class Meta(type):
self.assertEqual(self._callFUT((Meta, type)), Metameta)

@_skip_under_py2
def test_meta_of_class_py3k(self): # pragma: no cover (tox runs coverage on Python 2)
def test_meta_of_class_py3k(self):
# Work around SyntaxError under Python2.
EXEC = '\n'.join([
'class Metameta(type):',
Expand Down Expand Up @@ -249,7 +249,7 @@ class B(type):
self.assertEqual(self._callFUT((A, B,)), Meta_B)

@_skip_under_py2
def test_multiple_in_hierarchy_py3k(self): # pragma: no cover (tox runs coverage on Python 2)
def test_multiple_in_hierarchy_py3k(self):
# Work around SyntaxError under Python2.
EXEC = '\n'.join([
'class Meta_A(type):',
Expand Down Expand Up @@ -282,7 +282,7 @@ class B(type):
self.assertRaises(TypeError, self._callFUT, (A, B,))

@_skip_under_py2
def test_multiple_not_in_hierarchy_py3k(self): # pragma: no cover (tox runs coverage on Python 2)
def test_multiple_not_in_hierarchy_py3k(self):
# Work around SyntaxError under Python2.
EXEC = '\n'.join([
'class Meta_A(type):',
Expand Down
4 changes: 2 additions & 2 deletions src/zope/interface/tests/test_declarations.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,10 +964,10 @@ class MetaClass(type):
def __getattribute__(cls, name):
# Emulate metaclass whose base is not the type object.
if name == '__class__':
return self
return cls
# Under certain circumstances, the implementedByFallback
# can get here for __dict__
return type.__getattribute__(self, name) # pragma: no cover
return type.__getattribute__(cls, name) # pragma: no cover

class Foo(object):
__metaclass__ = MetaClass
Expand Down
2 changes: 1 addition & 1 deletion src/zope/interface/tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ def _errorsEqual(self, has_invariant, error_len, error_msgs, iface):
e = []
try:
iface.validateInvariants(has_invariant, e)
self.fail("validateInvariants should always rais")
self.fail("validateInvariants should always raise")
except Invalid as error:
self.assertEqual(error.args[0], e)

Expand Down

0 comments on commit bc0b2a9

Please sign in to comment.