Turns out that the added typing was wrong, not the isinstance()
check so add back the isinstance() check and change the type to Any
instead.
return {o for o in self.intersect if self.expected_dict[o] == self.current_dict[o]}
-def pytest_assertrepr_compare(op: str, left: MkosiConfig, right: Dict[str, Any]) -> List[str]:
+def pytest_assertrepr_compare(op: str, left: MkosiConfig, right: Any) -> List[str]:
+ if not isinstance(right, dict):
+ return []
for r in right.values():
if not isinstance(vars(r), dict):
return ["Invalid datatype"]