class X def main try assert 'a' not in 'ab' # will fail catch exc as Exception # should pass assert "('a' not 'ab')" not in exc.message assert "('a' not in 'ab')" in exc.message a, b = 'x', 'xy' try assert a is not b # will fail catch exc as Exception # should pass assert "('x' is 'xy')" not in exc.message assert "('x' is not 'xy')" in exc.message