Skip to content

Commit

Permalink
perf: Minor performance improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
  • Loading branch information
Stranger6667 committed May 17, 2024
1 parent 921e66d commit e757e84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/schemathesis/specs/openapi/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def get_strategies_from_examples(self, operation: APIOperation) -> list[SearchSt
return get_strategies_from_examples(operation, self.examples_field)

def get_response_schema(self, definition: dict[str, Any], scope: str) -> tuple[list[str], dict[str, Any] | None]:
scopes, definition = self.resolver.resolve_in_scope(fast_deepcopy(definition), scope)
scopes, definition = self.resolver.resolve_in_scope(definition, scope)
schema = definition.get("schema")
if not schema:
return scopes, None
Expand Down Expand Up @@ -1089,7 +1089,7 @@ def collect_parameters(
return collected

def get_response_schema(self, definition: dict[str, Any], scope: str) -> tuple[list[str], dict[str, Any] | None]:
scopes, definition = self.resolver.resolve_in_scope(fast_deepcopy(definition), scope)
scopes, definition = self.resolver.resolve_in_scope(definition, scope)
options = iter(definition.get("content", {}).values())
option = next(options, None)
# "schema" is an optional key in the `MediaType` object
Expand Down

0 comments on commit e757e84

Please sign in to comment.