Skip to content

Commit 5ee6010

Browse files
committed
Mark some test schema methods as no cover since they are not always used
1 parent e0492df commit 5ee6010

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/views/schema.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class DebugInfo:
8383
@strawberry.type
8484
class Query:
8585
@strawberry.field
86-
def greetings(self) -> str:
86+
def greetings(self) -> str: # pragma: no cover
8787
return "hello"
8888

8989
@strawberry.field
@@ -114,7 +114,7 @@ async def exception(self, message: str) -> str:
114114
raise ValueError(message)
115115

116116
@strawberry.field
117-
def teapot(self, info: strawberry.Info[Any, None]) -> str:
117+
def teapot(self, info: strawberry.Info[Any, None]) -> str: # pragma: no cover
118118
info.context["response"].status_code = 418
119119

120120
return "🫖"
@@ -148,7 +148,7 @@ def set_header(self, info: strawberry.Info, name: str) -> str:
148148
@strawberry.type
149149
class Mutation:
150150
@strawberry.mutation
151-
def echo(self, string_to_echo: str) -> str:
151+
def echo(self, string_to_echo: str) -> str: # pragma: no cover
152152
return string_to_echo
153153

154154
@strawberry.mutation
@@ -168,7 +168,7 @@ def read_folder(self, folder: FolderInput) -> List[str]:
168168
return list(map(_read_file, folder.files))
169169

170170
@strawberry.mutation
171-
def match_text(self, text_file: Upload, pattern: str) -> str:
171+
def match_text(self, text_file: Upload, pattern: str) -> str: # pragma: no cover
172172
text = text_file.read().decode()
173173
return pattern if pattern in text else ""
174174

@@ -205,7 +205,7 @@ async def exception(self, message: str) -> AsyncGenerator[str, None]:
205205
raise ValueError(message)
206206

207207
# Without this yield, the method is not recognised as an async generator
208-
yield "Hi"
208+
yield "Hi" # pragma: no cover
209209

210210
@strawberry.subscription
211211
async def flavors(self) -> AsyncGenerator[Flavor, None]:

0 commit comments

Comments
 (0)