def test_boolean(x): """ Given a non-boolean value, when boolean() is called with it, then it raises ValueError. """ with pytest.raises(ValueError): mod.boolean(x)
def test_boolean_with_bool_value(x): """ Given a boolean value, when boolean() is called with it, then it does not raise, and returns the value passed to it. """ assert mod.boolean(x) == x