Merge pull request #1042 from Bjwebb/issue411

Add __eq__ method to assertion comparison example
This commit is contained in:
Floris Bruynooghe 2015-09-21 14:57:59 +01:00
commit 7c3be72ac7
1 changed files with 4 additions and 1 deletions

View File

@ -200,7 +200,10 @@ now, given this test module::
# content of test_foocompare.py # content of test_foocompare.py
class Foo: class Foo:
def __init__(self, val): def __init__(self, val):
self.val = val self.val = val
def __eq__(self, other):
return self.val == other.val
def test_compare(): def test_compare():
f1 = Foo(1) f1 = Foo(1)