def test_member_variable(): obj = m.Dummy(12) with pytest.raises(AttributeError): obj.member # pylint: disable=pointless-statement assert obj.member_ is True
def test_member_function(): obj = m.Dummy(42) with pytest.raises(AttributeError): obj.hash # pylint: disable=pointless-statement assert obj.__hash__() == 42 assert hash(obj) == 42
def test_member_variable(): obj = m.Dummy(12) assert not hasattr(obj, "member") assert obj.member_ is True
def test_conversion_operator(): obj = m.Dummy(5) assert obj.__int__() == 5 assert int(obj) == 5
def test_member_function(): obj = m.Dummy(42) assert not hasattr(obj, "hash") assert obj.__hash__() == 42 assert hash(obj) == 42