Treat frozenset as a set

Thanks to Brianna Laugher.
This commit is contained in:
Floris Bruynooghe 2013-04-28 20:59:10 +01:00
parent 3ab94544b9
commit 7a90515d49
2 changed files with 6 additions and 1 deletions

View File

@ -94,7 +94,7 @@ def assertrepr_compare(config, op, left, right):
issequence = lambda x: isinstance(x, (list, tuple))
istext = lambda x: isinstance(x, basestring)
isdict = lambda x: isinstance(x, dict)
isset = lambda x: isinstance(x, set)
isset = lambda x: isinstance(x, (set, frozenset))
verbose = config.getoption('verbose')
explanation = None

View File

@ -99,6 +99,11 @@ class TestAssert_reprcompare:
expl = callequal(set([0, 1]), set([0, 2]))
assert len(expl) > 1
def test_frozenzet(self):
expl = callequal(frozenset([0, 1]), set([0, 2]))
print expl
assert len(expl) > 1
def test_list_tuples(self):
expl = callequal([], [(1,2)])
assert len(expl) > 1