Skip to content

Commit

Permalink
Test deprecate on a method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jun 27, 2017
1 parent 2a168e7 commit 8efcefd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/zope/deprecation/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def _makeOne(self, msg, *args):
return cls(msg, *args)

def fixture(self):
raise NotImplementedError()
return 42

def test___call__(self):
proxy = self._makeOne('hello')
Expand All @@ -494,6 +494,14 @@ def test___call__(self):
self.warnings.w,
[('hello', DeprecationWarning, 2)])

def test___call__method(self):
proxy = self._makeOne('method')
result = proxy(self.fixture)
self.assertEqual(result(), 42)
self.assertEqual(
self.warnings.w,
[('method', DeprecationWarning, 2)])

def test___call__with_custom_cls(self):
proxy = self._makeOne('hello', DummyWarning)
result = proxy(functionfixture)
Expand Down

0 comments on commit 8efcefd

Please sign in to comment.