conftest.py defines an ApproxDict, which is a subclass of dict, whose equality method has been overridden such that, if a and b are dictionaries, then a == ApproxDict(b) will have the same truth value as a.items() >= b.items() (i.e. a is equal to ApproxDict(b) if a's key-value pairs are a superset of b's key-value pairs).
Since a.items() >= b.items() is a much clearer assertion than a == ApproxDict(b), let's replace usages of ApproxDict in our test suite with the more explicit assertion.
conftest.py
defines anApproxDict
, which is a subclass ofdict
, whose equality method has been overridden such that, ifa
andb
are dictionaries, thena == ApproxDict(b)
will have the same truth value asa.items() >= b.items()
(i.e.a
is equal toApproxDict(b)
ifa
's key-value pairs are a superset ofb
's key-value pairs).Since
a.items() >= b.items()
is a much clearer assertion thana == ApproxDict(b)
, let's replace usages ofApproxDict
in our test suite with the more explicit assertion.