(self)
| 2144 | self.assertEqual(number_attrs(Numbers()), list(range(280))) |
| 2145 | |
| 2146 | def test_methods(self): |
| 2147 | # Testing methods... |
| 2148 | class C(object): |
| 2149 | def __init__(self, x): |
| 2150 | self.x = x |
| 2151 | def foo(self): |
| 2152 | return self.x |
| 2153 | c1 = C(1) |
| 2154 | self.assertEqual(c1.foo(), 1) |
| 2155 | class D(C): |
| 2156 | boo = C.foo |
| 2157 | goo = c1.foo |
| 2158 | d2 = D(2) |
| 2159 | self.assertEqual(d2.foo(), 2) |
| 2160 | self.assertEqual(d2.boo(), 2) |
| 2161 | self.assertEqual(d2.goo(), 1) |
| 2162 | class E(object): |
| 2163 | foo = C.foo |
| 2164 | self.assertEqual(E().foo.__func__, C.foo) # i.e., unbound |
| 2165 | self.assertStartsWith(repr(C.foo.__get__(C(1))), "<bound method ") |
| 2166 | |
| 2167 | @support.impl_detail("testing error message from implementation") |
| 2168 | def test_methods_in_c(self): |
nothing calls this directly
no test coverage detected