Add more explicit test

This commit is contained in:
Hynek Schlawack 2020-05-02 14:04:40 +02:00
parent 5a0491c3e1
commit be71c30792
1 changed files with 12 additions and 0 deletions

View File

@ -436,6 +436,18 @@ class TestDarkMagic(object):
assert hash(C()) != hash(C())
@pytest.mark.parametrize("slots", [True, False])
def test_eq_false(self, slots):
"""
eq=False makes a class hashable by ID.
"""
@attr.s(eq=False, slots=slots)
class C(object):
pass
assert hash(C()) != hash(C())
def test_overwrite_base(self):
"""
Base classes can overwrite each other and the attributes are added