Skip to content

Commit

Permalink
refactor: Remove redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Oct 2, 2020
1 parent 0091174 commit 33e1463
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/schemathesis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,10 @@ def get_code_to_reproduce(self, headers: Optional[Dict[str, Any]] = None) -> str
kwargs["headers"] = final_headers
method = kwargs["method"].lower()

def are_defaults(key: str, value: Optional[Dict]) -> bool:
default_value: Optional[Dict] = {"json": None}.get(key, None)
return value == default_value

printed_kwargs = ", ".join(
f"{key}={repr(value)}"
for key, value in kwargs.items()
if key not in ("method", "url") and not are_defaults(key, value)
if key not in ("method", "url") and value is not None
)
args_repr = f"'{kwargs['url']}'"
if printed_kwargs:
Expand Down

0 comments on commit 33e1463

Please sign in to comment.