def test_contains(container): item = object() added = s.contains_add(container, item) assert isinstance(added, type(container)) assert item in added removed = s.contains_remove(added, item) assert isinstance(removed, type(container)) assert item not in removed
def _lens_contains_add(self, item): return Box(s.contains_add(self.value, item))
def test_contains_add_failure(): with pytest.raises(NotImplementedError): s.contains_add(True, object())