@@ -26,7 +26,7 @@ class _InterfaceImplementationTestCase(_BaseTestCase):
26
26
class ValidImpl (_InterfaceImplementationTestCase ):
27
27
@nexusrpc .service
28
28
class Interface :
29
- op : nexusrpc .Operation [None , None ] # type: ignore[reportUninitializedInstanceVariable]
29
+ op : nexusrpc .Operation [None , None ]
30
30
31
31
def unrelated_method (self ) -> None : ...
32
32
@@ -54,7 +54,7 @@ def unrelated_method(self) -> None: ...
54
54
class ValidImplWithoutTypeAnnotations (_InterfaceImplementationTestCase ):
55
55
@nexusrpc .service
56
56
class Interface :
57
- op : nexusrpc .Operation [int , str ] # type: ignore[reportUninitializedInstanceVariable]
57
+ op : nexusrpc .Operation [int , str ]
58
58
59
59
with warnings .catch_warnings (record = True ) as _warnings :
60
60
warnings .simplefilter ("always" )
@@ -74,7 +74,7 @@ async def op(self, ctx, input): ... # type: ignore[reportMissingParameterType]
74
74
class MissingOperation (_InterfaceImplementationTestCase ):
75
75
@nexusrpc .service
76
76
class Interface :
77
- op : nexusrpc .Operation [None , None ] # type: ignore[reportUninitializedInstanceVariable]
77
+ op : nexusrpc .Operation [None , None ]
78
78
79
79
class Impl :
80
80
pass
@@ -85,7 +85,7 @@ class Impl:
85
85
class MissingInputAnnotation (_InterfaceImplementationTestCase ):
86
86
@nexusrpc .service
87
87
class Interface :
88
- op : nexusrpc .Operation [None , None ] # type: ignore[reportUninitializedInstanceVariable]
88
+ op : nexusrpc .Operation [None , None ]
89
89
90
90
with warnings .catch_warnings (record = True ) as _warnings :
91
91
warnings .simplefilter ("always" )
@@ -105,7 +105,7 @@ async def op(self, ctx: StartOperationContext, input) -> None: ... # type: igno
105
105
class MissingContextAnnotation (_InterfaceImplementationTestCase ):
106
106
@nexusrpc .service
107
107
class Interface :
108
- op : nexusrpc .Operation [None , None ] # type: ignore[reportUninitializedInstanceVariable]
108
+ op : nexusrpc .Operation [None , None ]
109
109
110
110
with warnings .catch_warnings (record = True ) as _warnings :
111
111
warnings .simplefilter ("always" )
@@ -125,7 +125,7 @@ async def op(self, ctx, input: None) -> None: ... # type: ignore[reportMissingP
125
125
class WrongOutputType (_InterfaceImplementationTestCase ):
126
126
@nexusrpc .service
127
127
class Interface :
128
- op : nexusrpc .Operation [None , int ] # type: ignore[reportUninitializedInstanceVariable]
128
+ op : nexusrpc .Operation [None , int ]
129
129
130
130
class Impl :
131
131
@sync_operation
@@ -137,7 +137,7 @@ async def op(self, ctx: StartOperationContext, input: None) -> str: ...
137
137
class WrongOutputTypeWithNone (_InterfaceImplementationTestCase ):
138
138
@nexusrpc .service
139
139
class Interface :
140
- op : nexusrpc .Operation [str , None ] # type: ignore[reportUninitializedInstanceVariable]
140
+ op : nexusrpc .Operation [str , None ]
141
141
142
142
class Impl :
143
143
@sync_operation
@@ -149,7 +149,7 @@ async def op(self, ctx: StartOperationContext, input: str) -> str: ...
149
149
class ValidImplWithNone (_InterfaceImplementationTestCase ):
150
150
@nexusrpc .service
151
151
class Interface :
152
- op : nexusrpc .Operation [str , None ] # type: ignore[reportUninitializedInstanceVariable]
152
+ op : nexusrpc .Operation [str , None ]
153
153
154
154
class Impl :
155
155
@sync_operation
@@ -161,7 +161,7 @@ async def op(self, ctx: StartOperationContext, input: str) -> None: ...
161
161
class MoreSpecificImplAllowed (_InterfaceImplementationTestCase ):
162
162
@nexusrpc .service
163
163
class Interface :
164
- op : nexusrpc .Operation [Any , Any ] # type: ignore[reportUninitializedInstanceVariable]
164
+ op : nexusrpc .Operation [Any , Any ]
165
165
166
166
class Impl :
167
167
@sync_operation
@@ -185,7 +185,7 @@ class Subclass(SuperClass):
185
185
class OutputCovarianceImplOutputCanBeSameType (_InterfaceImplementationTestCase ):
186
186
@nexusrpc .service
187
187
class Interface :
188
- op : nexusrpc .Operation [X , X ] # type: ignore[reportUninitializedInstanceVariable]
188
+ op : nexusrpc .Operation [X , X ]
189
189
190
190
class Impl :
191
191
@sync_operation
@@ -197,7 +197,7 @@ async def op(self, ctx: StartOperationContext, input: X) -> X: ...
197
197
class OutputCovarianceImplOutputCanBeSubclass (_InterfaceImplementationTestCase ):
198
198
@nexusrpc .service
199
199
class Interface :
200
- op : nexusrpc .Operation [X , SuperClass ] # type: ignore[reportUninitializedInstanceVariable]
200
+ op : nexusrpc .Operation [X , SuperClass ]
201
201
202
202
class Impl :
203
203
@sync_operation
@@ -211,7 +211,7 @@ class OutputCovarianceImplOutputCannnotBeStrictSuperclass(
211
211
):
212
212
@nexusrpc .service
213
213
class Interface :
214
- op : nexusrpc .Operation [X , Subclass ] # type: ignore[reportUninitializedInstanceVariable]
214
+ op : nexusrpc .Operation [X , Subclass ]
215
215
216
216
class Impl :
217
217
@sync_operation
@@ -223,7 +223,7 @@ async def op(self, ctx: StartOperationContext, input: X) -> SuperClass: ...
223
223
class InputContravarianceImplInputCanBeSameType (_InterfaceImplementationTestCase ):
224
224
@nexusrpc .service
225
225
class Interface :
226
- op : nexusrpc .Operation [X , X ] # type: ignore[reportUninitializedInstanceVariable]
226
+ op : nexusrpc .Operation [X , X ]
227
227
228
228
class Impl :
229
229
@sync_operation
@@ -235,7 +235,7 @@ async def op(self, ctx: StartOperationContext, input: X) -> X: ...
235
235
class InputContravarianceImplInputCanBeSuperclass (_InterfaceImplementationTestCase ):
236
236
@nexusrpc .service
237
237
class Interface :
238
- op : nexusrpc .Operation [Subclass , X ] # type: ignore[reportUninitializedInstanceVariable]
238
+ op : nexusrpc .Operation [Subclass , X ]
239
239
240
240
class Impl :
241
241
@sync_operation
@@ -247,7 +247,7 @@ async def op(self, ctx: StartOperationContext, input: SuperClass) -> X: ...
247
247
class InputContravarianceImplInputCannotBeSubclass (_InterfaceImplementationTestCase ):
248
248
@nexusrpc .service
249
249
class Interface :
250
- op : nexusrpc .Operation [SuperClass , X ] # type: ignore[reportUninitializedInstanceVariable]
250
+ op : nexusrpc .Operation [SuperClass , X ]
251
251
252
252
class Impl :
253
253
@sync_operation
@@ -297,7 +297,7 @@ def test_service_decorator_enforces_interface_implementation(
297
297
def test_service_does_not_implement_operation_name ():
298
298
@nexusrpc .service
299
299
class Contract :
300
- operation_a : nexusrpc .Operation [None , None ] # type: ignore[reportUninitializedInstanceVariable]
300
+ operation_a : nexusrpc .Operation [None , None ]
301
301
302
302
class Service :
303
303
@sync_operation
0 commit comments