def test_boolean_fail(self): with raises(AssertionError) as exc: types.boolean('a string') assert exc.value.args[0] == 'not of type boolean'
def test_boolean_pass(self): assert types.boolean(False) is None