From: Daan De Meyer Date: Thu, 7 Apr 2022 08:48:25 +0000 (+0200) Subject: tests: Add back isinstance() check to pytest_assertrepr_compare() X-Git-Tag: v13~50^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8852f6143c0660fa3b07b842ab91d86ee1569efc;p=thirdparty%2Fmkosi.git tests: Add back isinstance() check to pytest_assertrepr_compare() 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. --- diff --git a/tests/conftest.py b/tests/conftest.py index 2719333c3..662acdd77 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,7 +30,9 @@ class DictDiffer: 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"]