(self)
| 1921 | self.assertNotHasAttr(a, 'x') |
| 1922 | |
| 1923 | def test_newslots(self): |
| 1924 | # Testing __new__ slot override... |
| 1925 | class C(list): |
| 1926 | def __new__(cls): |
| 1927 | self = list.__new__(cls) |
| 1928 | self.foo = 1 |
| 1929 | return self |
| 1930 | def __init__(self): |
| 1931 | self.foo = self.foo + 2 |
| 1932 | a = C() |
| 1933 | self.assertEqual(a.foo, 3) |
| 1934 | self.assertEqual(a.__class__, C) |
| 1935 | class D(C): |
| 1936 | pass |
| 1937 | b = D() |
| 1938 | self.assertEqual(b.foo, 3) |
| 1939 | self.assertEqual(b.__class__, D) |
| 1940 | |
| 1941 | @unittest.expectedFailure |
| 1942 | def test_bad_new(self): |
nothing calls this directly
no test coverage detected