(self)
| 3054 | self.assertIsInstance(C(), P) |
| 3055 | |
| 3056 | def test_subprotocols_extending(self): |
| 3057 | class P1(Protocol): |
| 3058 | def meth1(self): |
| 3059 | pass |
| 3060 | |
| 3061 | @runtime_checkable |
| 3062 | class P2(P1, Protocol): |
| 3063 | def meth2(self): |
| 3064 | pass |
| 3065 | |
| 3066 | class C: |
| 3067 | def meth1(self): |
| 3068 | pass |
| 3069 | |
| 3070 | def meth2(self): |
| 3071 | pass |
| 3072 | |
| 3073 | class C1: |
| 3074 | def meth1(self): |
| 3075 | pass |
| 3076 | |
| 3077 | class C2: |
| 3078 | def meth2(self): |
| 3079 | pass |
| 3080 | |
| 3081 | self.assertNotIsInstance(C1(), P2) |
| 3082 | self.assertNotIsInstance(C2(), P2) |
| 3083 | self.assertNotIsSubclass(C1, P2) |
| 3084 | self.assertNotIsSubclass(C2, P2) |
| 3085 | self.assertIsInstance(C(), P2) |
| 3086 | self.assertIsSubclass(C, P2) |
| 3087 | |
| 3088 | def test_subprotocols_merging(self): |
| 3089 | class P1(Protocol): |
nothing calls this directly
no test coverage detected