def test_extract_optional_with_wrong_type(): with pytest.raises(ValueError): extract_optional(List[None])
def test_extract_optional(): assert extract_optional(Optional[int]) == int