(self)
| 5155 | self.assertEqual("'foo' in __slots__ conflicts with class variable", m) |
| 5156 | |
| 5157 | def test_set_doc(self): |
| 5158 | class X: |
| 5159 | "elephant" |
| 5160 | X.__doc__ = "banana" |
| 5161 | self.assertEqual(X.__doc__, "banana") |
| 5162 | |
| 5163 | with self.assertRaises(TypeError) as cm: |
| 5164 | type(list).__dict__["__doc__"].__set__(list, "blah") |
| 5165 | self.assertIn("cannot set '__doc__' attribute of immutable type 'list'", str(cm.exception)) |
| 5166 | |
| 5167 | with self.assertRaises(TypeError) as cm: |
| 5168 | type(X).__dict__["__doc__"].__delete__(X) |
| 5169 | self.assertIn("cannot delete '__doc__' attribute of type 'X'", str(cm.exception)) |
| 5170 | self.assertEqual(X.__doc__, "banana") |
| 5171 | |
| 5172 | def test_qualname(self): |
| 5173 | descriptors = [str.lower, complex.real, float.real, int.__add__] |
nothing calls this directly
no test coverage detected