'test that filter_traceback() works with the fact that
py.code.Code.path attribute might return an str object.
In this case, one of the entries on the traceback was produced by
dynamically generated code.
See: https://bitbucket.org/pytest-dev/py/issues/71
This fixes #995.'

def test_filter_traceback_generated_code(self):

    from _pytest.python import filter_traceback
    try:
        ns = {}
        exec 'def    foo():    raise    ValueError' in ns
        ns['foo']()
    except ValueError:
        (_, _, tb) = sys.exc_info()
    tb = _pytest._code.Traceback(tb)
    assert isinstance(tb[(-1)].path, str)
    assert (not filter_traceback(tb[(-1)]))
