def test_should_raise_error_when_value_does_not_represent_true_or_false(self, value): with pytest.raises(ValueError) as exc_info: bool_converter(value) assert f'{value} does not represent a boolean' == str(exc_info.value)
def test_should_return_true_when_value_represent_truthy(self, value): assert bool_converter(value) is True
def test_should_return_false_when_value_does_not_represent_truthy(self, value): assert bool_converter(value) is False
def test_should_return_given_value_if_it_is_not_a_string(self, value): assert value == bool_converter(value)