{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/3345","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3345/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3345/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3345/events","html_url":"https://github.com/pytest-dev/pytest/pull/3345","id":308913979,"number":3345,"title":"#3332 improve traceback for import error","user":{"login":"feuillemorte","id":9434344,"avatar_url":"https://avatars0.githubusercontent.com/u/9434344?v=4","gravatar_id":"","url":"https://api.github.com/users/feuillemorte","html_url":"https://github.com/feuillemorte","followers_url":"https://api.github.com/users/feuillemorte/followers","following_url":"https://api.github.com/users/feuillemorte/following{/other_user}","gists_url":"https://api.github.com/users/feuillemorte/gists{/gist_id}","starred_url":"https://api.github.com/users/feuillemorte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feuillemorte/subscriptions","organizations_url":"https://api.github.com/users/feuillemorte/orgs","repos_url":"https://api.github.com/users/feuillemorte/repos","events_url":"https://api.github.com/users/feuillemorte/events{/privacy}","received_events_url":"https://api.github.com/users/feuillemorte/received_events","type":"User","site_admin":false},"labels":[{"id":240500027,"url":"https://api.github.com/repos/pytest-dev/pytest/labels/topic:%20tracebacks","name":"topic: tracebacks","color":"c5def5","default":false},{"id":224849195,"url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20enhancement","name":"type: enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-27T10:38:13Z","updated_at":"2018-04-11T20:55:41Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/3345","html_url":"https://github.com/pytest-dev/pytest/pull/3345","diff_url":"https://github.com/pytest-dev/pytest/pull/3345.diff","patch_url":"https://github.com/pytest-dev/pytest/pull/3345.patch"},"body":"Fixes #3332\r\n\r\nOutput:\r\n\r\n```\r\nImportError while importing test module '/home/username/github/pytest-dev/pytest/pytest_3332/tests/conftest.py'.\r\nHint: make sure your test modules/packages have valid Python names.\r\nTraceback:\r\n  File \"/home/username/github/pytest-dev/pytest/pytest_upstream/env/lib/python3.6/site-packages/pytest-3.5.1.dev11+g12a5f609-py3.6.egg/_pytest/assertion/rewrite.py\", line 213, in load_module\r\n    py.builtin.exec_(co, mod.__dict__)\r\n  File \"/home/username/github/pytest-dev/pytest/pytest_3332/tests/conftest.py\", line 1, in <module>\r\n    import wrong_import\r\n\r\nE    ModuleNotFoundError: No module named 'wrong_import'\r\n```"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/380592718","html_url":"https://github.com/pytest-dev/pytest/pull/3345#issuecomment-380592718","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3345","id":380592718,"user":{"login":"nicoddemus","id":1085180,"avatar_url":"https://avatars2.githubusercontent.com/u/1085180?v=4","gravatar_id":"","url":"https://api.github.com/users/nicoddemus","html_url":"https://github.com/nicoddemus","followers_url":"https://api.github.com/users/nicoddemus/followers","following_url":"https://api.github.com/users/nicoddemus/following{/other_user}","gists_url":"https://api.github.com/users/nicoddemus/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoddemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoddemus/subscriptions","organizations_url":"https://api.github.com/users/nicoddemus/orgs","repos_url":"https://api.github.com/users/nicoddemus/repos","events_url":"https://api.github.com/users/nicoddemus/events{/privacy}","received_events_url":"https://api.github.com/users/nicoddemus/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T20:55:41Z","updated_at":"2018-04-11T20:55:41Z","author_association":"OWNER","body":"> Do we really need config.getoption('verbose') here?\r\n\r\n> We get beautiful traceback :)\r\n\r\nI kinda disagree, I would prefer a traceback which shows only the error in the `conftest.py` file, namely this:\r\n\r\n```\r\nFile \"/tmp/pytest-of-feuillemorte/pytest-63/test_issue109_sibling_conftests_not_loaded0/sub1/conftest.py\", line 1, in <module>\r\n    assert 0\r\n\r\n```\r\n\r\nAlso it is not a good idea to change `sys.tracebacklimit = 0` I think because we would be changing a global and never restoring it.\r\n\r\nBtw sorry I didn't have time to take a look at your PR yet. Thanks for the patience. 😁 "}}
{"actor":{"display_login":"nicoddemus"}}