{"action":"created","comment":{"url":"https://api.github.com/repos/JukkaL/mypy/pulls/comments/41724181","id":41724181,"diff_hunk":"@@ -0,0 +1,79 @@\n+from typing import Callable, List, Tuple, Union\n+\n+import os\n+import tempfile\n+\n+from mypy.myunit.errors import SkipTestCaseException\n+\n+\n+class TestCase:\n+    def __init__(self, name: str, suite: 'Suite' = None,\n+                 func: Callable[[], None] = None) -> None:\n+        self.func = func\n+        self.name = name\n+        self.suite = suite\n+        self.old_cwd = None  # type: str\n+        self.tmpdir = None  # type: tempfile.TemporaryDirectory\n+\n+    def run(self) -> None:\n+        if self.func:\n+            self.func()\n+\n+    def set_up(self) -> None:\n+        self.old_cwd = os.getcwd()\n+        self.tmpdir = tempfile.TemporaryDirectory(prefix='mypy-test-',\n+                dir=os.path.abspath('tmp-test-dirs'))\n+        os.chdir(self.tmpdir.name)\n+        os.mkdir('tmp')\n+        if self.suite:\n+            self.suite.set_up()\n+\n+    def tear_down(self) -> None:\n+        if self.suite:\n+            self.suite.tear_down()\n+        os.chdir(self.old_cwd)\n+        self.tmpdir.cleanup()\n+        self.old_cwd = None\n+        self.tmpdir = None\n+\n+\n+TestUnion = Union[TestCase, Tuple[str, 'Suite']]","path":"mypy/myunit/suite.py","position":40,"original_position":40,"commit_id":"3560b4be6f028398f4b1305c6ae2949745a063c1","original_commit_id":"3560b4be6f028398f4b1305c6ae2949745a063c1","user":{"login":"o11c","id":964689,"avatar_url":"https://avatars.githubusercontent.com/u/964689?v=3","gravatar_id":"","url":"https://api.github.com/users/o11c","html_url":"https://github.com/o11c","followers_url":"https://api.github.com/users/o11c/followers","following_url":"https://api.github.com/users/o11c/following{/other_user}","gists_url":"https://api.github.com/users/o11c/gists{/gist_id}","starred_url":"https://api.github.com/users/o11c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o11c/subscriptions","organizations_url":"https://api.github.com/users/o11c/orgs","repos_url":"https://api.github.com/users/o11c/repos","events_url":"https://api.github.com/users/o11c/events{/privacy}","received_events_url":"https://api.github.com/users/o11c/received_events","type":"User","site_admin":false},"body":"`NotSureWhatWouldWork = Union[TestCase, Tuple[str, 'Suite']]` ?","created_at":"2015-10-12T05:19:22Z","updated_at":"2015-10-12T05:19:22Z","html_url":"https://github.com/JukkaL/mypy/pull/914#discussion_r41724181","pull_request_url":"https://api.github.com/repos/JukkaL/mypy/pulls/914","_links":{"self":{"href":"https://api.github.com/repos/JukkaL/mypy/pulls/comments/41724181"},"html":{"href":"https://github.com/JukkaL/mypy/pull/914#discussion_r41724181"},"pull_request":{"href":"https://api.github.com/repos/JukkaL/mypy/pulls/914"}}},"pull_request":{"url":"https://api.github.com/repos/JukkaL/mypy/pulls/914","id":47385251,"html_url":"https://github.com/JukkaL/mypy/pull/914","diff_url":"https://github.com/JukkaL/mypy/pull/914.diff","patch_url":"https://github.com/JukkaL/mypy/pull/914.patch","issue_url":"https://api.github.com/repos/JukkaL/mypy/issues/914","number":914,"state":"open","locked":false,"title":"Myunit","user":{"login":"o11c","id":964689,"avatar_url":"https://avatars.githubusercontent.com/u/964689?v=3","gravatar_id":"","url":"https://api.github.com/users/o11c","html_url":"https://github.com/o11c","followers_url":"https://api.github.com/users/o11c/followers","following_url":"https://api.github.com/users/o11c/following{/other_user}","gists_url":"https://api.github.com/users/o11c/gists{/gist_id}","starred_url":"https://api.github.com/users/o11c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o11c/subscriptions","organizations_url":"https://api.github.com/users/o11c/orgs","repos_url":"https://api.github.com/users/o11c/repos","events_url":"https://api.github.com/users/o11c/events{/privacy}","received_events_url":"https://api.github.com/users/o11c/received_events","type":"User","site_admin":false},"body":"Split myunit into separate modules. Preparation for #908.\r\n\r\nDisable the lint warning about glob imports, there is nothing wrong with them if they are used carefully, and mypy itself will warn if you misuse them.\r\n\r\nAlso pass `-q` by default so it's less glitchy, to both myunit and unittest, though note that unittest will still produce *some* point.","created_at":"2015-10-12T04:36:35Z","updated_at":"2015-10-12T05:19:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28e740b705f4f16a65262d114d3457ea6f667db6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JukkaL/mypy/pulls/914/commits","review_comments_url":"https://api.github.com/repos/JukkaL/mypy/pulls/914/comments","review_comment_url":"https://api.github.com/repos/JukkaL/mypy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JukkaL/mypy/issues/914/comments","statuses_url":"https://api.github.com/repos/JukkaL/mypy/statuses/3560b4be6f028398f4b1305c6ae2949745a063c1","head":{"label":"o11c:myunit","ref":"myunit","sha":"3560b4be6f028398f4b1305c6ae2949745a063c1","user":{"login":"o11c","id":964689,"avatar_url":"https://avatars.githubusercontent.com/u/964689?v=3","gravatar_id":"","url":"https://api.github.com/users/o11c","html_url":"https://github.com/o11c","followers_url":"https://api.github.com/users/o11c/followers","following_url":"https://api.github.com/users/o11c/following{/other_user}","gists_url":"https://api.github.com/users/o11c/gists{/gist_id}","starred_url":"https://api.github.com/users/o11c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o11c/subscriptions","organizations_url":"https://api.github.com/users/o11c/orgs","repos_url":"https://api.github.com/users/o11c/repos","events_url":"https://api.github.com/users/o11c/events{/privacy}","received_events_url":"https://api.github.com/users/o11c/received_events","type":"User","site_admin":false},"repo":{"id":37350767,"name":"mypy","full_name":"o11c/mypy","owner":{"login":"o11c","id":964689,"avatar_url":"https://avatars.githubusercontent.com/u/964689?v=3","gravatar_id":"","url":"https://api.github.com/users/o11c","html_url":"https://github.com/o11c","followers_url":"https://api.github.com/users/o11c/followers","following_url":"https://api.github.com/users/o11c/following{/other_user}","gists_url":"https://api.github.com/users/o11c/gists{/gist_id}","starred_url":"https://api.github.com/users/o11c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o11c/subscriptions","organizations_url":"https://api.github.com/users/o11c/orgs","repos_url":"https://api.github.com/users/o11c/repos","events_url":"https://api.github.com/users/o11c/events{/privacy}","received_events_url":"https://api.github.com/users/o11c/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/o11c/mypy","description":"Optional static typing for Python","fork":true,"url":"https://api.github.com/repos/o11c/mypy","forks_url":"https://api.github.com/repos/o11c/mypy/forks","keys_url":"https://api.github.com/repos/o11c/mypy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/o11c/mypy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/o11c/mypy/teams","hooks_url":"https://api.github.com/repos/o11c/mypy/hooks","issue_events_url":"https://api.github.com/repos/o11c/mypy/issues/events{/number}","events_url":"https://api.github.com/repos/o11c/mypy/events","assignees_url":"https://api.github.com/repos/o11c/mypy/assignees{/user}","branches_url":"https://api.github.com/repos/o11c/mypy/branches{/branch}","tags_url":"https://api.github.com/repos/o11c/mypy/tags","blobs_url":"https://api.github.com/repos/o11c/mypy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/o11c/mypy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/o11c/mypy/git/refs{/sha}","trees_url":"https://api.github.com/repos/o11c/mypy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/o11c/mypy/statuses/{sha}","languages_url":"https://api.github.com/repos/o11c/mypy/languages","stargazers_url":"https://api.github.com/repos/o11c/mypy/stargazers","contributors_url":"https://api.github.com/repos/o11c/mypy/contributors","subscribers_url":"https://api.github.com/repos/o11c/mypy/subscribers","subscription_url":"https://api.github.com/repos/o11c/mypy/subscription","commits_url":"https://api.github.com/repos/o11c/mypy/commits{/sha}","git_commits_url":"https://api.github.com/repos/o11c/mypy/git/commits{/sha}","comments_url":"https://api.github.com/repos/o11c/mypy/comments{/number}","issue_comment_url":"https://api.github.com/repos/o11c/mypy/issues/comments{/number}","contents_url":"https://api.github.com/repos/o11c/mypy/contents/{+path}","compare_url":"https://api.github.com/repos/o11c/mypy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/o11c/mypy/merges","archive_url":"https://api.github.com/repos/o11c/mypy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/o11c/mypy/downloads","issues_url":"https://api.github.com/repos/o11c/mypy/issues{/number}","pulls_url":"https://api.github.com/repos/o11c/mypy/pulls{/number}","milestones_url":"https://api.github.com/repos/o11c/mypy/milestones{/number}","notifications_url":"https://api.github.com/repos/o11c/mypy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/o11c/mypy/labels{/name}","releases_url":"https://api.github.com/repos/o11c/mypy/releases{/id}","created_at":"2015-06-13T00:15:06Z","updated_at":"2015-10-03T22:01:49Z","pushed_at":"2015-10-12T04:33:20Z","git_url":"git://github.com/o11c/mypy.git","ssh_url":"git@github.com:o11c/mypy.git","clone_url":"https://github.com/o11c/mypy.git","svn_url":"https://github.com/o11c/mypy","homepage":"http://www.mypy-lang.org/","size":10677,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"JukkaL:master","ref":"master","sha":"47b40a7782338b7745796cd564ce040add8ccd36","user":{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars.githubusercontent.com/u/1107911?v=3","gravatar_id":"","url":"https://api.github.com/users/JukkaL","html_url":"https://github.com/JukkaL","followers_url":"https://api.github.com/users/JukkaL/followers","following_url":"https://api.github.com/users/JukkaL/following{/other_user}","gists_url":"https://api.github.com/users/JukkaL/gists{/gist_id}","starred_url":"https://api.github.com/users/JukkaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JukkaL/subscriptions","organizations_url":"https://api.github.com/users/JukkaL/orgs","repos_url":"https://api.github.com/users/JukkaL/repos","events_url":"https://api.github.com/users/JukkaL/events{/privacy}","received_events_url":"https://api.github.com/users/JukkaL/received_events","type":"User","site_admin":false},"repo":{"id":7053637,"name":"mypy","full_name":"JukkaL/mypy","owner":{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars.githubusercontent.com/u/1107911?v=3","gravatar_id":"","url":"https://api.github.com/users/JukkaL","html_url":"https://github.com/JukkaL","followers_url":"https://api.github.com/users/JukkaL/followers","following_url":"https://api.github.com/users/JukkaL/following{/other_user}","gists_url":"https://api.github.com/users/JukkaL/gists{/gist_id}","starred_url":"https://api.github.com/users/JukkaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JukkaL/subscriptions","organizations_url":"https://api.github.com/users/JukkaL/orgs","repos_url":"https://api.github.com/users/JukkaL/repos","events_url":"https://api.github.com/users/JukkaL/events{/privacy}","received_events_url":"https://api.github.com/users/JukkaL/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JukkaL/mypy","description":"Optional static typing for Python","fork":false,"url":"https://api.github.com/repos/JukkaL/mypy","forks_url":"https://api.github.com/repos/JukkaL/mypy/forks","keys_url":"https://api.github.com/repos/JukkaL/mypy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JukkaL/mypy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JukkaL/mypy/teams","hooks_url":"https://api.github.com/repos/JukkaL/mypy/hooks","issue_events_url":"https://api.github.com/repos/JukkaL/mypy/issues/events{/number}","events_url":"https://api.github.com/repos/JukkaL/mypy/events","assignees_url":"https://api.github.com/repos/JukkaL/mypy/assignees{/user}","branches_url":"https://api.github.com/repos/JukkaL/mypy/branches{/branch}","tags_url":"https://api.github.com/repos/JukkaL/mypy/tags","blobs_url":"https://api.github.com/repos/JukkaL/mypy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JukkaL/mypy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JukkaL/mypy/git/refs{/sha}","trees_url":"https://api.github.com/repos/JukkaL/mypy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JukkaL/mypy/statuses/{sha}","languages_url":"https://api.github.com/repos/JukkaL/mypy/languages","stargazers_url":"https://api.github.com/repos/JukkaL/mypy/stargazers","contributors_url":"https://api.github.com/repos/JukkaL/mypy/contributors","subscribers_url":"https://api.github.com/repos/JukkaL/mypy/subscribers","subscription_url":"https://api.github.com/repos/JukkaL/mypy/subscription","commits_url":"https://api.github.com/repos/JukkaL/mypy/commits{/sha}","git_commits_url":"https://api.github.com/repos/JukkaL/mypy/git/commits{/sha}","comments_url":"https://api.github.com/repos/JukkaL/mypy/comments{/number}","issue_comment_url":"https://api.github.com/repos/JukkaL/mypy/issues/comments{/number}","contents_url":"https://api.github.com/repos/JukkaL/mypy/contents/{+path}","compare_url":"https://api.github.com/repos/JukkaL/mypy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JukkaL/mypy/merges","archive_url":"https://api.github.com/repos/JukkaL/mypy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JukkaL/mypy/downloads","issues_url":"https://api.github.com/repos/JukkaL/mypy/issues{/number}","pulls_url":"https://api.github.com/repos/JukkaL/mypy/pulls{/number}","milestones_url":"https://api.github.com/repos/JukkaL/mypy/milestones{/number}","notifications_url":"https://api.github.com/repos/JukkaL/mypy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JukkaL/mypy/labels{/name}","releases_url":"https://api.github.com/repos/JukkaL/mypy/releases{/id}","created_at":"2012-12-07T13:30:23Z","updated_at":"2015-10-11T04:32:38Z","pushed_at":"2015-10-12T04:36:35Z","git_url":"git://github.com/JukkaL/mypy.git","ssh_url":"git@github.com:JukkaL/mypy.git","clone_url":"https://github.com/JukkaL/mypy.git","svn_url":"https://github.com/JukkaL/mypy","homepage":"http://www.mypy-lang.org/","size":12838,"stargazers_count":760,"watchers_count":760,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":265,"forks":94,"open_issues":265,"watchers":760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JukkaL/mypy/pulls/914"},"html":{"href":"https://github.com/JukkaL/mypy/pull/914"},"issue":{"href":"https://api.github.com/repos/JukkaL/mypy/issues/914"},"comments":{"href":"https://api.github.com/repos/JukkaL/mypy/issues/914/comments"},"review_comments":{"href":"https://api.github.com/repos/JukkaL/mypy/pulls/914/comments"},"review_comment":{"href":"https://api.github.com/repos/JukkaL/mypy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JukkaL/mypy/pulls/914/commits"},"statuses":{"href":"https://api.github.com/repos/JukkaL/mypy/statuses/3560b4be6f028398f4b1305c6ae2949745a063c1"}}}}