{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/905","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/905/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/905/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/905/events","html_url":"https://github.com/pytest-dev/pytest/issues/905","id":98145239,"number":905,"title":"INTERNALERROR with pytest.mark.parametrize and __tracebackhide__","user":{"login":"philpep","id":387511,"avatar_url":"https://avatars.githubusercontent.com/u/387511?v=3","gravatar_id":"","url":"https://api.github.com/users/philpep","html_url":"https://github.com/philpep","followers_url":"https://api.github.com/users/philpep/followers","following_url":"https://api.github.com/users/philpep/following{/other_user}","gists_url":"https://api.github.com/users/philpep/gists{/gist_id}","starred_url":"https://api.github.com/users/philpep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philpep/subscriptions","organizations_url":"https://api.github.com/users/philpep/orgs","repos_url":"https://api.github.com/users/philpep/repos","events_url":"https://api.github.com/users/philpep/events{/privacy}","received_events_url":"https://api.github.com/users/philpep/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-30T11:31:58Z","updated_at":"2015-07-30T11:36:43Z","closed_at":null,"body":"Hi,\r\n\r\nI don't known if it's a py or a pytest related bug, but i didn't find the project page for py so I submit the issue here.\r\n\r\nConsider this test:\r\n\r\n```python\r\nimport pytest\r\n\r\n\r\n@pytest.mark.parametrize(\"param\", [\"foo\"])\r\ndef test(param):\r\n    __tracebackhide__ = True\r\n    assert param == \"bar\"\r\n\r\n````\r\n\r\nThe test fail as expected but not as expected :)\r\n\r\n````text\r\n$ py.test test_bug.py\r\n==== test session starts ====\r\nplatform linux2 -- Python 2.7.9, pytest-2.8.0.dev4, py-1.4.30, pluggy-0.3.0\r\nrootdir: /home/phil/src/pytest, inifile: tox.ini\r\ncollected 1 items \r\n\r\ntest_bug.py\r\n\r\n[...]\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 333, in <lambda>\r\nINTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 595, in execute\r\nINTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 253, in _wrapped_call\r\nINTERNALERROR>     return call_outcome.get_result()\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 279, in get_result\r\nINTERNALERROR>     _reraise(*ex)  # noqa\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 264, in __init__\r\nINTERNALERROR>     self.result = func()\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 596, in execute\r\nINTERNALERROR>     res = hook_impl.function(*args)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/runner.py\", line 67, in pytest_runtest_protocol\r\nINTERNALERROR>     runtestprotocol(item, nextitem=nextitem)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/runner.py\", line 77, in runtestprotocol\r\nINTERNALERROR>     reports.append(call_and_report(item, \"call\", log))\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/runner.py\", line 123, in call_and_report\r\nINTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 724, in __call__\r\nINTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 338, in _hookexec\r\nINTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 333, in <lambda>\r\nINTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 595, in execute\r\nINTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 249, in _wrapped_call\r\nINTERNALERROR>     wrap_controller.send(call_outcome)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/skipping.py\", line 170, in pytest_runtest_makereport\r\nINTERNALERROR>     rep = outcome.get_result()\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 279, in get_result\r\nINTERNALERROR>     _reraise(*ex)  # noqa\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 264, in __init__\r\nINTERNALERROR>     self.result = func()\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/pluggy-0.3.0-py2.7.egg/pluggy.py\", line 596, in execute\r\nINTERNALERROR>     res = hook_impl.function(*args)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/runner.py\", line 226, in pytest_runtest_makereport\r\nINTERNALERROR>     longrepr = item.repr_failure(excinfo)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/python.py\", line 665, in repr_failure\r\nINTERNALERROR>     return self._repr_failure_py(excinfo, style=style)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/python.py\", line 658, in _repr_failure_py\r\nINTERNALERROR>     style=style)\r\nINTERNALERROR>   File \"/home/phil/src/pytest/_pytest/main.py\", line 406, in _repr_failure_py\r\nINTERNALERROR>     style=style, tbfilter=tbfilter)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/py-1.4.30-py2.7.egg/py/_code/code.py\", line 412, in getrepr\r\nINTERNALERROR>     return fmt.repr_excinfo(self)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/py-1.4.30-py2.7.egg/py/_code/code.py\", line 590, in repr_excinfo\r\nINTERNALERROR>     reprtraceback = self.repr_traceback(excinfo)\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/py-1.4.30-py2.7.egg/py/_code/code.py\", line 577, in repr_traceback\r\nINTERNALERROR>     last = traceback[-1]\r\nINTERNALERROR>   File \"/home/phil/venvs/pytest/local/lib/python2.7/site-packages/py-1.4.30-py2.7.egg/py/_code/code.py\", line 284, in __getitem__\r\nINTERNALERROR>     val = super(Traceback, self).__getitem__(key)\r\nINTERNALERROR> IndexError: list index out of range\r\n````\r\n\r\nSame issue on 2.7.2 and on master branch (0b83b4076adcb9d0177b9bab2ff6891c4065bab7)\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/126282605","html_url":"https://github.com/pytest-dev/pytest/issues/905#issuecomment-126282605","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/905","id":126282605,"user":{"login":"RonnyPfannschmidt","id":156838,"avatar_url":"https://avatars.githubusercontent.com/u/156838?v=3","gravatar_id":"","url":"https://api.github.com/users/RonnyPfannschmidt","html_url":"https://github.com/RonnyPfannschmidt","followers_url":"https://api.github.com/users/RonnyPfannschmidt/followers","following_url":"https://api.github.com/users/RonnyPfannschmidt/following{/other_user}","gists_url":"https://api.github.com/users/RonnyPfannschmidt/gists{/gist_id}","starred_url":"https://api.github.com/users/RonnyPfannschmidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RonnyPfannschmidt/subscriptions","organizations_url":"https://api.github.com/users/RonnyPfannschmidt/orgs","repos_url":"https://api.github.com/users/RonnyPfannschmidt/repos","events_url":"https://api.github.com/users/RonnyPfannschmidt/events{/privacy}","received_events_url":"https://api.github.com/users/RonnyPfannschmidt/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T11:36:43Z","updated_at":"2015-07-30T11:36:43Z","body":"its a pylib bug, by default anything above the test function is cut off, now if you in addition make it filter out the test function, then it helplessly has to resign at the empty traceback\r\n\r\nthis is a missed condition in py.code"}}