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