[decorators test] use assertIsInstance as expected

authorSylvain Th?nault <sylvain.thenault@logilab.fr>
changeset42985b1dff16
branchstable
phasepublic
hiddenno
parent revision#bd15ee92a347 python3: fix code and test so most tests go green. Partially closes #104047
child revision#6172d6933e10 [registry] enhance assertion error message, #8d13747da834 [py3k @cached] fix compat of dark corners for the @monkeypatch decorator, making tests pass. Closes #104047
files modified by this revision
test/unittest_decorators.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1350977670 -7200
# Tue Oct 23 09:34:30 2012 +0200
# Branch stable
# Node ID 42985b1dff16372e73939c6cde5ca00b768cbf60
# Parent bd15ee92a34750051b310aa7d4e0bdcc834ac0e7
[decorators test] use assertIsInstance as expected

diff --git a/test/unittest_decorators.py b/test/unittest_decorators.py
@@ -44,18 +44,18 @@
1          @property
2          def meth1(self):
3              return 12
4          class XXX(object):
5              def __call__(self, other):
6 -                tester.assertTrue(isinstance(other, MyClass))
7 +                tester.assertIsInstance(other, MyClass)
8                  return 12
9          try:
10              monkeypatch(MyClass)(XXX())
11          except AttributeError, err:
12              self.assertTrue(str(err).endswith('has no __name__ attribute: you should provide an explicit `methodname`'))
13          monkeypatch(MyClass, 'foo')(XXX())
14 -        self.assertTrue(isinstance(MyClass.prop1, property))
15 +        self.assertIsInstance(MyClass.prop1, property)
16          self.assertTrue(callable(MyClass.foo))
17          self.assertEqual(MyClass().prop1, 12)
18          self.assertEqual(MyClass().foo(), 12)
19 
20      def test_monkeypatch_with_same_name(self):