Skip to content

Commit

Permalink
Mark some test schema methods as no cover since they are not always used
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Apr 2, 2024
1 parent e0492df commit 5ee6010
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/views/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DebugInfo:
@strawberry.type
class Query:
@strawberry.field
def greetings(self) -> str:
def greetings(self) -> str: # pragma: no cover
return "hello"

@strawberry.field
Expand Down Expand Up @@ -114,7 +114,7 @@ async def exception(self, message: str) -> str:
raise ValueError(message)

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

return "🫖"
Expand Down Expand Up @@ -148,7 +148,7 @@ def set_header(self, info: strawberry.Info, name: str) -> str:
@strawberry.type
class Mutation:
@strawberry.mutation
def echo(self, string_to_echo: str) -> str:
def echo(self, string_to_echo: str) -> str: # pragma: no cover
return string_to_echo

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

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

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

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

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

0 comments on commit 5ee6010

Please sign in to comment.