Skip to content

Commit 8e23b42

Browse files
committed
Move no-type-annotations test to invalid usage test
1 parent 0bd5e7b commit 8e23b42

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

tests/nexus/test_workflow_run_operation.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
import uuid
23
from dataclasses import dataclass
34
from typing import Any, Type
@@ -71,15 +72,6 @@ class Service:
7172
op: Operation[Input, str]
7273

7374

74-
@service_handler
75-
class SubclassingNoInputOutputTypeAnnotationsWithoutServiceDefinition:
76-
@operation_handler
77-
def op(self) -> OperationHandler:
78-
return MyOperation()
79-
80-
__expected__error__ = 500, "'dict' object has no attribute 'value'"
81-
82-
8375
@service_handler(service=Service)
8476
class SubclassingNoInputOutputTypeAnnotationsWithServiceDefinition:
8577
# Despite the lack of annotations on the service impl, the service definition
@@ -94,7 +86,6 @@ def op(self) -> OperationHandler:
9486
"service_handler_cls",
9587
[
9688
SubclassingHappyPath,
97-
SubclassingNoInputOutputTypeAnnotationsWithoutServiceDefinition,
9889
SubclassingNoInputOutputTypeAnnotationsWithServiceDefinition,
9990
],
10091
)
@@ -123,7 +114,7 @@ async def test_workflow_run_operation(
123114
status_code, message = service_handler_cls.__expected__error__
124115
assert resp.status_code == status_code
125116
failure = Failure(**resp.json())
126-
assert failure.message == message
117+
assert re.search(message, failure.message)
127118
else:
128119
assert resp.status_code == 201
129120

0 commit comments

Comments
 (0)