{"action":"closed","issue":{"url":"https://api.github.com/repos/Yelp/Testify/issues/124","labels_url":"https://api.github.com/repos/Yelp/Testify/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/Yelp/Testify/issues/124/comments","events_url":"https://api.github.com/repos/Yelp/Testify/issues/124/events","html_url":"https://github.com/Yelp/Testify/issues/124","id":9102768,"number":124,"title":"testify doesn't report the import error correctly when test path is given as a file path","user":{"login":"baris","id":17591,"avatar_url":"https://avatars.githubusercontent.com/u/17591?v=3","gravatar_id":"","url":"https://api.github.com/users/baris","html_url":"https://github.com/baris","followers_url":"https://api.github.com/users/baris/followers","following_url":"https://api.github.com/users/baris/following{/other_user}","gists_url":"https://api.github.com/users/baris/gists{/gist_id}","starred_url":"https://api.github.com/users/baris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baris/subscriptions","organizations_url":"https://api.github.com/users/baris/orgs","repos_url":"https://api.github.com/users/baris/repos","events_url":"https://api.github.com/users/baris/events{/privacy}","received_events_url":"https://api.github.com/users/baris/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Yelp/Testify/labels/p2","name":"p2","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Yelp/Testify/milestones/2","html_url":"https://github.com/Yelp/Testify/milestones/0.6.0","labels_url":"https://api.github.com/repos/Yelp/Testify/milestones/2/labels","id":743857,"number":2,"title":"0.6.0","description":"Several quick wins to bring real benefits to all yelpmain developers in the short term.","creator":{"login":"bukzor","id":640328,"avatar_url":"https://avatars.githubusercontent.com/u/640328?v=3","gravatar_id":"","url":"https://api.github.com/users/bukzor","html_url":"https://github.com/bukzor","followers_url":"https://api.github.com/users/bukzor/followers","following_url":"https://api.github.com/users/bukzor/following{/other_user}","gists_url":"https://api.github.com/users/bukzor/gists{/gist_id}","starred_url":"https://api.github.com/users/bukzor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bukzor/subscriptions","organizations_url":"https://api.github.com/users/bukzor/orgs","repos_url":"https://api.github.com/users/bukzor/repos","events_url":"https://api.github.com/users/bukzor/events{/privacy}","received_events_url":"https://api.github.com/users/bukzor/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2014-08-05T17:14:18Z","updated_at":"2015-02-28T18:42:07Z","due_on":"2014-10-01T07:00:00Z","closed_at":null},"comments":3,"created_at":"2012-12-07T22:03:54Z","updated_at":"2015-02-28T18:42:07Z","closed_at":"2015-02-28T18:42:07Z","body":"The output is pretty confusing. The root of the issue is test_discovery.py:discover:discover_inner nested function. It only gives the extra information if the second try to import the module is successful. \n\nIn the first case below second try was successful since testify tried to import the parent package test.plugins when it wasn't able to import test.plugings.violation_collector_test.\n\nThe fix looks easy, but I think the code in discover function needs to be refactored and needs test coverage.\n\n```\n$ testify test/plugins -v\nDISCOVERY FAILURE!\nThere was a problem importing one or more tests:\nFailed to find module test/plugins\n\nNo tests were discovered (tests must subclass TestCase and test methods must begin with 'test').\nERROR.  0 tests / 0 cases: 0 passed, 0 failed.  (Total test time 0.00s)\n```\n\n```\n$ testify test.plugins -v\nDISCOVERY FAILURE!\nThere was a problem importing one or more tests:\ndiscovery(test.plugins.violation_collector_test) failed: module <module 'test.plugins' from './test/plugins/__init__.pyc'> has no attribute 'violation_collector_test'; this is most likely due to earlier error ImportError('No module named non_existent_module',)\n\nNo tests were discovered (tests must subclass TestCase and test methods must begin with 'test').\nERROR.  0 tests / 0 cases: 0 passed, 0 failed.  (Total test time 0.00s)\n```\n\n```\n$ cat test_import_error.py\nimport testify as T\nimport non_existent_module\n\nclass ImportErrorTest(T.TestCase):\n    def test_nothing(self):\n        pass\n\n$ testify test_import_error.py -v\nDISCOVERY FAILURE!\nThere was a problem importing one or more tests:\nFailed to find module test_import_error.py\n\nNo tests were discovered (tests must subclass TestCase and test methods must begin with 'test').\nERROR.  0 tests / 0 cases: 0 passed, 0 failed.  (Total test time 0.00s)\n```"}}