(self)
| 275 | self.assertNotEqual(Self, None) |
| 276 | |
| 277 | def test_basics(self): |
| 278 | class Foo: |
| 279 | def bar(self) -> Self: ... |
| 280 | class FooStr: |
| 281 | def bar(self) -> 'Self': ... |
| 282 | class FooStrTyping: |
| 283 | def bar(self) -> 'typing.Self': ... |
| 284 | |
| 285 | for target in [Foo, FooStr, FooStrTyping]: |
| 286 | with self.subTest(target=target): |
| 287 | self.assertEqual(gth(target.bar), {'return': Self}) |
| 288 | self.assertIs(get_origin(Self), None) |
| 289 | |
| 290 | def test_repr(self): |
| 291 | self.assertEqual(repr(Self), 'typing.Self') |
nothing calls this directly
no test coverage detected