{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/2042","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2042/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2042/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2042/events","html_url":"https://github.com/pytest-dev/pytest/issues/2042","id":186813051,"node_id":"MDU6SXNzdWUxODY4MTMwNTE=","number":2042,"title":"get rid of \"ImportMismatchError\"","user":{"login":"hpk42","id":73579,"node_id":"MDQ6VXNlcjczNTc5","avatar_url":"https://avatars2.githubusercontent.com/u/73579?v=4","gravatar_id":"","url":"https://api.github.com/users/hpk42","html_url":"https://github.com/hpk42","followers_url":"https://api.github.com/users/hpk42/followers","following_url":"https://api.github.com/users/hpk42/following{/other_user}","gists_url":"https://api.github.com/users/hpk42/gists{/gist_id}","starred_url":"https://api.github.com/users/hpk42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpk42/subscriptions","organizations_url":"https://api.github.com/users/hpk42/orgs","repos_url":"https://api.github.com/users/hpk42/repos","events_url":"https://api.github.com/users/hpk42/events{/privacy}","received_events_url":"https://api.github.com/users/hpk42/received_events","type":"User","site_admin":false},"labels":[{"id":240511492,"node_id":"MDU6TGFiZWwyNDA1MTE0OTI=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/topic:%20collection","name":"topic: collection","color":"006b75","default":false},{"id":224849195,"node_id":"MDU6TGFiZWwyMjQ4NDkxOTU=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20enhancement","name":"type: enhancement","color":"84b6eb","default":false},{"id":323103543,"node_id":"MDU6TGFiZWwzMjMxMDM1NDM=","url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20feature-branch","name":"type: feature-branch","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":66,"created_at":"2016-11-02T14:18:28Z","updated_at":"2018-09-24T16:27:10Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Over on the tox issue tracker, there was a [discussion about the irritating \"ImportMismatchError\"](https://github.com/tox-dev/tox/issues/373#issuecomment-256979815) that pytest throws if one collects from the source tree but the imports actually come from some installed location (e.g. some virtualenv).  This happens more often with tox i guess because the default way of testing with tox is creating and installing a package and then collecting from the source tree. \r\n\r\n@jaraco and me agreed that it's probably best to try improve pytest so that it, say with pytest-4.0, will automatically redirect from source to install location.  Initially and up until the next major release we could introduce a ``--collect-redirect-to-installed=yes`` option or so which works like this: if during collection we find a python package (a directory with an ``__init__.py`` for now)  we check if importing it will actually get it from another location.  If so, we redirect to the install location and also report this fact.   Only problem is that with python3 one can have python packages without ``__init__.py`` files so the actual logic needs to take that into account as well (how many people are really using this, btw?).\r\n"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/424037549","html_url":"https://github.com/pytest-dev/pytest/issues/2042#issuecomment-424037549","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2042","id":424037549,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDAzNzU0OQ==","user":{"login":"brianbruggeman","id":1350114,"node_id":"MDQ6VXNlcjEzNTAxMTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1350114?v=4","gravatar_id":"","url":"https://api.github.com/users/brianbruggeman","html_url":"https://github.com/brianbruggeman","followers_url":"https://api.github.com/users/brianbruggeman/followers","following_url":"https://api.github.com/users/brianbruggeman/following{/other_user}","gists_url":"https://api.github.com/users/brianbruggeman/gists{/gist_id}","starred_url":"https://api.github.com/users/brianbruggeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianbruggeman/subscriptions","organizations_url":"https://api.github.com/users/brianbruggeman/orgs","repos_url":"https://api.github.com/users/brianbruggeman/repos","events_url":"https://api.github.com/users/brianbruggeman/events{/privacy}","received_events_url":"https://api.github.com/users/brianbruggeman/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T16:27:10Z","updated_at":"2018-09-24T16:27:10Z","author_association":"NONE","body":"Warnings are good as long as there's a way to silence them..."}}
{"actor":{"display_login":"brianbruggeman"}}