(self)
| 2047 | self.assertEqual(number_attrs(Numbers()), list(range(280))) |
| 2048 | |
| 2049 | def test_methods(self): |
| 2050 | # Testing methods... |
| 2051 | class C(object): |
| 2052 | def __init__(self, x): |
| 2053 | self.x = x |
| 2054 | def foo(self): |
| 2055 | return self.x |
| 2056 | c1 = C(1) |
| 2057 | self.assertEqual(c1.foo(), 1) |
| 2058 | class D(C): |
| 2059 | boo = C.foo |
| 2060 | goo = c1.foo |
| 2061 | d2 = D(2) |
| 2062 | self.assertEqual(d2.foo(), 2) |
| 2063 | self.assertEqual(d2.boo(), 2) |
| 2064 | self.assertEqual(d2.goo(), 1) |
| 2065 | class E(object): |
| 2066 | foo = C.foo |
| 2067 | self.assertEqual(E().foo.__func__, C.foo) # i.e., unbound |
| 2068 | self.assertStartsWith(repr(C.foo.__get__(C(1))), "<bound method ") |
| 2069 | |
| 2070 | @support.impl_detail("testing error message from implementation") |
| 2071 | def test_methods_in_c(self): |
nothing calls this directly
no test coverage detected