def test_enforces_variable_id_is_str(es): assert variable_types.Categorical("1", es["customers"]) with pytest.raises(AssertionError): variable_types.Categorical(1, es["customers"])
def test_enforces_variable_id_is_str(es): assert variable_types.Categorical("1", es["customers"]) error_text = 'Variable id must be a string' with pytest.raises(AssertionError, match=error_text): variable_types.Categorical(1, es["customers"])