def it_can_validate_a_value_as_a_python_string(self, valid_str_fixture): value, expected_exception = valid_str_fixture if expected_exception is None: BaseSimpleType.validate_string(value) else: with pytest.raises(expected_exception): BaseSimpleType.validate_string(value)