def test_ipset_exceptions(): s1 = IPSet(['10.0.0.1']) # IPSet objects are not hashable. with pytest.raises(TypeError): hash(s1) # Bad update argument type. with pytest.raises(TypeError): s1.update(42)