def test_eval(): with pytest.warns(RuntimeWarning): v = eval('debug.format(1)') assert str(v) == '<string>:1 <module>\n 1 (int)'