Skip to content

Commit

Permalink
Ignore type-errors related to attr.asdict
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Aug 26, 2022
1 parent 71b79fc commit aae93d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/_pytest/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,15 @@ def _report_to_json(report: BaseReport) -> Dict[str, Any]:
def serialize_repr_entry(
entry: Union[ReprEntry, ReprEntryNative]
) -> Dict[str, Any]:
data = attr.asdict(entry)
data = attr.asdict(entry) # type:ignore[arg-type]
for key, value in data.items():
if hasattr(value, "__dict__"):
data[key] = attr.asdict(value)
entry_data = {"type": type(entry).__name__, "data": data}
return entry_data

def serialize_repr_traceback(reprtraceback: ReprTraceback) -> Dict[str, Any]:
result = attr.asdict(reprtraceback)
result = attr.asdict(reprtraceback) # type:ignore[arg-type]
result["reprentries"] = [
serialize_repr_entry(x) for x in reprtraceback.reprentries
]
Expand All @@ -473,7 +473,7 @@ def serialize_repr_crash(
reprcrash: Optional[ReprFileLocation],
) -> Optional[Dict[str, Any]]:
if reprcrash is not None:
return attr.asdict(reprcrash)
return attr.asdict(reprcrash) # type:ignore[arg-type]
else:
return None

Expand Down

0 comments on commit aae93d6

Please sign in to comment.