Merge pull request #1042 from Bjwebb/issue411
Add __eq__ method to assertion comparison example
This commit is contained in:
commit
7c3be72ac7
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue