by quietbritishjim · 5y ago · 0 comments
result = ["a", "b", "b"]
assert set(result) == {"a", "b"}
In fact that is the first main motivating failure case discussed in the readme. But actually that's simple enough to deal with too: from collections import Counter
assert Counter(result) = {"a": 1, "b": 1}
But would be trickier for mutable / unhashable types (not sure if "precisely" can deal with those).More specifically, writing:
contains_exactly("a", "b")
is equivalent to: contains_exactly(equal_to("a"), equal_to("b"))