{"action":"created","issue":{"url":"https://api.github.com/repos/python-mode/python-mode/issues/377","repository_url":"https://api.github.com/repos/python-mode/python-mode","labels_url":"https://api.github.com/repos/python-mode/python-mode/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/python-mode/python-mode/issues/377/comments","events_url":"https://api.github.com/repos/python-mode/python-mode/issues/377/events","html_url":"https://github.com/python-mode/python-mode/issues/377","id":26848260,"number":377,"title":"Using python-mode to run unit tests stops execution of the script with no error","user":{"login":"dafergu2","id":1692895,"avatar_url":"https://avatars1.githubusercontent.com/u/1692895?v=4","gravatar_id":"","url":"https://api.github.com/users/dafergu2","html_url":"https://github.com/dafergu2","followers_url":"https://api.github.com/users/dafergu2/followers","following_url":"https://api.github.com/users/dafergu2/following{/other_user}","gists_url":"https://api.github.com/users/dafergu2/gists{/gist_id}","starred_url":"https://api.github.com/users/dafergu2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dafergu2/subscriptions","organizations_url":"https://api.github.com/users/dafergu2/orgs","repos_url":"https://api.github.com/users/dafergu2/repos","events_url":"https://api.github.com/users/dafergu2/events{/privacy}","received_events_url":"https://api.github.com/users/dafergu2/received_events","type":"User","site_admin":false},"labels":[{"id":836243035,"url":"https://api.github.com/repos/python-mode/python-mode/labels/inactive","name":"inactive","color":"ffffff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2014-02-03T23:45:24Z","updated_at":"2018-03-06T21:57:21Z","closed_at":null,"author_association":"NONE","body":"I have the following project structure:\n\n```\n-- /home/myuser/testscripts/\n   | -- tests\n   |   |  __init__.py\n   |   |  my_unit_test_class.py\n   |  test_main.py\n   |  .vimrc\n```\n\ntest_main.py\n\n``` python\n\nimport unittest\n\nimport sys\nsys.path.append('/home/myuser/test-scripts/')\nsys.path.append('/home/myuser/test-scripts/tests')\n\nfrom tests import MyUnitTestClass\n\nprint \"Before unittest.main()...\"\nunittest.main()\nprint \"After unittest.main()...\"\n```\n\nmy_unit_test_class.py\n\n``` python\nimport unittest\n\nclass MyUnitTestClass(unittest.TestCase):\n\n    def setUp(self):\n        pass\n\n    def tearDown(self):\n        pass\n\n    def test_version(self):\n        version = \"some version string\"\n        self.assertIsNotNone(version)\n        print \"I have run!\"\n```\n\nThe output in the preview pane opened by `<leader>r` is:\n\n> \"Before main...\"\n\nA couple of things...first, I had to append the paths in the file itself (actually, I did it in my project specific .vimrc) in order for the import to actually work.  Otherwise, I'll get an error importing.  Second, I have other tests and test files that are set up to be skipped.  It shouldn't be relevant, but I figured I would mention it.  Third, the current working directory when I launch vim is in the root of my project structure.\n\nLastly, the output when run from command line is:\n\n> Before main...\n> I have run!\n> .ssssss\n> ----------------------------------------------------\n> Run 7 tests in 0.011s\n> \n> OK (skipped=6)\n\n**Expected results:**\n\nThe entire script is run and its output printed, or an error message is printed.\n\n**Actual results:**\n\nThe script partially runs and \"Before main...\" is printed to the output.  No other output is given.\n## <bountysource-plugin>\n\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1424222-using-python-mode-to-run-unit-tests-stops-execution-of-the-script-with-no-error?utm_campaign=plugin&utm_content=tracker%2F42165&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F42165&utm_medium=issues&utm_source=github).\n</bountysource-plugin>\n"},"comment":{"url":"https://api.github.com/repos/python-mode/python-mode/issues/comments/370943286","html_url":"https://github.com/python-mode/python-mode/issues/377#issuecomment-370943286","issue_url":"https://api.github.com/repos/python-mode/python-mode/issues/377","id":370943286,"user":{"login":"stale[bot]","id":26384082,"avatar_url":"https://avatars2.githubusercontent.com/u/26350515?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-03-06T21:57:21Z","updated_at":"2018-03-06T21:57:21Z","author_association":"NONE","body":"Closed due to inactivity.\n"}}
{"actor":{"display_login":"stale"}}