From 9597e674d924f2bc026b9f2743b6716a2a5434c9 Mon Sep 17 00:00:00 2001 From: Kale Kundert Date: Fri, 16 Jun 2017 08:25:13 -0700 Subject: [PATCH] Use sets to compare dictionary keys. --- _pytest/python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/python_api.py b/_pytest/python_api.py index 91605aa550c..acc3ea28619 100644 --- a/_pytest/python_api.py +++ b/_pytest/python_api.py @@ -133,7 +133,7 @@ def __repr__(self): for k,v in self.expected.items())) def __eq__(self, actual): - if actual.keys() != self.expected.keys(): + if set(actual.keys()) != set(self.expected.keys()): return False return ApproxBase.__eq__(self, actual)