{"action":"created","comment":{"url":"https://api.github.com/repos/spyder-ide/spyder/pulls/comments/63084655","id":63084655,"diff_hunk":"@@ -0,0 +1,204 @@\n+# -*- coding: utf-8 -*-\n+#\n+# Copyright © 2009- The Spyder Development Team\n+# Licensed under the terms of the MIT License\n+#\n+\n+\"\"\"\n+\"\"\"\n+\n+# Third party imports\n+from qtpy.QtCore import Qt\n+from pytestqt import qtbot  # analysis:ignore\n+\n+# Local imports\n+from spyderlib.widgets.arraybuilder import NumpyArrayDialog\n+\n+\n+class TestNumpyArrayBuilder:\n+    def test_array_inline_array(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '1 2 3  4 5 6')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return)\n+\n+        expected_value = 'np.array([[1, 2, 3],\\n          [4, 5, 6]])'\n+        value = dlg.text()\n+        assert expected_value == value\n+\n+    def test_array_inline_matrix(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '4 5 6  7 8 9')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return, modifier=Qt.ControlModifier)\n+\n+        expected_value = 'np.matrix([[4, 5, 6],\\n           [7, 8, 9]])'\n+        value = dlg.text()\n+        assert expected_value == value\n+\n+    def test_array_inline_array_invalid(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '1 2  3 4  5 6 7')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return)\n+        dlg.update_warning()\n+\n+        assert not dlg.is_valid()\n+\n+    def test_array_inline_1d_array(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '4 5 6')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return, modifier=Qt.ControlModifier)\n+\n+        expected_value = 'np.matrix([4, 5, 6])'\n+        value = dlg.text()\n+        assert expected_value == value\n+\n+    def test_array_inline_nan_array(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '4 nan 6 8 9')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return, modifier=Qt.ControlModifier)\n+\n+        expected_value = 'np.matrix([4, np.nan, 6, 8, 9])'\n+        value = dlg.text()\n+        assert expected_value == value\n+\n+    def test_array_inline_force_float_array(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True, force_float=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '4 5 6 8 9')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return, modifier=Qt.ControlModifier)\n+\n+        expected_value = 'np.matrix([4.0, 5.0, 6.0, 8.0, 9.0])'\n+        value = dlg.text()\n+        assert expected_value == value\n+\n+    def test_array_inline_force_float_error_array(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=True, force_float=True)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClicks(dlg.widget, '4 5 6 a 9')\n+        qtbot.keyPress(dlg.widget, Qt.Key_Return, modifier=Qt.ControlModifier)\n+\n+        expected_value = 'np.matrix([4.0, 5.0, 6.0, a, 9.0])'\n+        value = dlg.text()\n+        assert expected_value == value\n+\n+    def test_array_table_array(self, qtbot):  # analysis:ignore\n+        dlg = NumpyArrayDialog(inline=False)\n+        dlg.show()\n+        qtbot.addWidget(dlg)\n+\n+        qtbot.keyClick(dlg.widget, Qt.Key_1)\n+        qtbot.keyClick(dlg.widget, Qt.Key_Tab)\n+        qtbot.keyClick(dlg.widget, Qt.Key_2)\n+        qtbot.keyClick(dlg.widget, Qt.Key_Tab)\n+        qtbot.keyClick(dlg.widget, Qt.Key_Backtab)  # Needed hack","path":"spyderlib/widgets/tests/test_array_builder.py","position":111,"original_position":111,"commit_id":"fcfbf8ba42f3e0921dcb782dd08c284869ad1ed4","original_commit_id":"fcfbf8ba42f3e0921dcb782dd08c284869ad1ed4","user":{"login":"Nodd","id":506348,"avatar_url":"https://avatars.githubusercontent.com/u/506348?v=3","gravatar_id":"","url":"https://api.github.com/users/Nodd","html_url":"https://github.com/Nodd","followers_url":"https://api.github.com/users/Nodd/followers","following_url":"https://api.github.com/users/Nodd/following{/other_user}","gists_url":"https://api.github.com/users/Nodd/gists{/gist_id}","starred_url":"https://api.github.com/users/Nodd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nodd/subscriptions","organizations_url":"https://api.github.com/users/Nodd/orgs","repos_url":"https://api.github.com/users/Nodd/repos","events_url":"https://api.github.com/users/Nodd/events{/privacy}","received_events_url":"https://api.github.com/users/Nodd/received_events","type":"User","site_admin":false},"body":"I see. The comment should be more precise then, like \"Hack: in the tests the selected cell is wrong\". It's fine if it's on its own line too, what's important is to tell why the line is needed.","created_at":"2016-05-12T19:46:57Z","updated_at":"2016-05-12T19:46:57Z","html_url":"https://github.com/spyder-ide/spyder/pull/3120#discussion_r63084655","pull_request_url":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120","_links":{"self":{"href":"https://api.github.com/repos/spyder-ide/spyder/pulls/comments/63084655"},"html":{"href":"https://github.com/spyder-ide/spyder/pull/3120#discussion_r63084655"},"pull_request":{"href":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120"}}},"pull_request":{"url":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120","id":67039463,"html_url":"https://github.com/spyder-ide/spyder/pull/3120","diff_url":"https://github.com/spyder-ide/spyder/pull/3120.diff","patch_url":"https://github.com/spyder-ide/spyder/pull/3120.patch","issue_url":"https://api.github.com/repos/spyder-ide/spyder/issues/3120","number":3120,"state":"open","locked":false,"title":"PR: Add pytests for array builder and coverage","user":{"login":"goanpeca","id":3627835,"avatar_url":"https://avatars.githubusercontent.com/u/3627835?v=3","gravatar_id":"","url":"https://api.github.com/users/goanpeca","html_url":"https://github.com/goanpeca","followers_url":"https://api.github.com/users/goanpeca/followers","following_url":"https://api.github.com/users/goanpeca/following{/other_user}","gists_url":"https://api.github.com/users/goanpeca/gists{/gist_id}","starred_url":"https://api.github.com/users/goanpeca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goanpeca/subscriptions","organizations_url":"https://api.github.com/users/goanpeca/orgs","repos_url":"https://api.github.com/users/goanpeca/repos","events_url":"https://api.github.com/users/goanpeca/events{/privacy}","received_events_url":"https://api.github.com/users/goanpeca/received_events","type":"User","site_admin":false},"body":"Fixes #2268 \r\nFixes #3122","created_at":"2016-04-19T15:29:34Z","updated_at":"2016-05-12T19:46:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84ea5d7eaa92354ed4b5183ec1fa657cd6a3e51a","assignee":{"login":"Nodd","id":506348,"avatar_url":"https://avatars.githubusercontent.com/u/506348?v=3","gravatar_id":"","url":"https://api.github.com/users/Nodd","html_url":"https://github.com/Nodd","followers_url":"https://api.github.com/users/Nodd/followers","following_url":"https://api.github.com/users/Nodd/following{/other_user}","gists_url":"https://api.github.com/users/Nodd/gists{/gist_id}","starred_url":"https://api.github.com/users/Nodd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nodd/subscriptions","organizations_url":"https://api.github.com/users/Nodd/orgs","repos_url":"https://api.github.com/users/Nodd/repos","events_url":"https://api.github.com/users/Nodd/events{/privacy}","received_events_url":"https://api.github.com/users/Nodd/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/spyder-ide/spyder/milestones/30","html_url":"https://github.com/spyder-ide/spyder/milestones/v3.0beta4","labels_url":"https://api.github.com/repos/spyder-ide/spyder/milestones/30/labels","id":1546411,"number":30,"title":"v3.0beta4","description":"","creator":{"login":"ccordoba12","id":365293,"avatar_url":"https://avatars.githubusercontent.com/u/365293?v=3","gravatar_id":"","url":"https://api.github.com/users/ccordoba12","html_url":"https://github.com/ccordoba12","followers_url":"https://api.github.com/users/ccordoba12/followers","following_url":"https://api.github.com/users/ccordoba12/following{/other_user}","gists_url":"https://api.github.com/users/ccordoba12/gists{/gist_id}","starred_url":"https://api.github.com/users/ccordoba12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccordoba12/subscriptions","organizations_url":"https://api.github.com/users/ccordoba12/orgs","repos_url":"https://api.github.com/users/ccordoba12/repos","events_url":"https://api.github.com/users/ccordoba12/events{/privacy}","received_events_url":"https://api.github.com/users/ccordoba12/received_events","type":"User","site_admin":false},"open_issues":48,"closed_issues":0,"state":"open","created_at":"2016-01-27T14:43:24Z","updated_at":"2016-05-04T14:26:33Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120/commits","review_comments_url":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120/comments","review_comment_url":"https://api.github.com/repos/spyder-ide/spyder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/3120/comments","statuses_url":"https://api.github.com/repos/spyder-ide/spyder/statuses/fcfbf8ba42f3e0921dcb782dd08c284869ad1ed4","head":{"label":"goanpeca:feature/pytests","ref":"feature/pytests","sha":"fcfbf8ba42f3e0921dcb782dd08c284869ad1ed4","user":{"login":"goanpeca","id":3627835,"avatar_url":"https://avatars.githubusercontent.com/u/3627835?v=3","gravatar_id":"","url":"https://api.github.com/users/goanpeca","html_url":"https://github.com/goanpeca","followers_url":"https://api.github.com/users/goanpeca/followers","following_url":"https://api.github.com/users/goanpeca/following{/other_user}","gists_url":"https://api.github.com/users/goanpeca/gists{/gist_id}","starred_url":"https://api.github.com/users/goanpeca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goanpeca/subscriptions","organizations_url":"https://api.github.com/users/goanpeca/orgs","repos_url":"https://api.github.com/users/goanpeca/repos","events_url":"https://api.github.com/users/goanpeca/events{/privacy}","received_events_url":"https://api.github.com/users/goanpeca/received_events","type":"User","site_admin":false},"repo":{"id":31085493,"name":"spyder","full_name":"goanpeca/spyder","owner":{"login":"goanpeca","id":3627835,"avatar_url":"https://avatars.githubusercontent.com/u/3627835?v=3","gravatar_id":"","url":"https://api.github.com/users/goanpeca","html_url":"https://github.com/goanpeca","followers_url":"https://api.github.com/users/goanpeca/followers","following_url":"https://api.github.com/users/goanpeca/following{/other_user}","gists_url":"https://api.github.com/users/goanpeca/gists{/gist_id}","starred_url":"https://api.github.com/users/goanpeca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goanpeca/subscriptions","organizations_url":"https://api.github.com/users/goanpeca/orgs","repos_url":"https://api.github.com/users/goanpeca/repos","events_url":"https://api.github.com/users/goanpeca/events{/privacy}","received_events_url":"https://api.github.com/users/goanpeca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/goanpeca/spyder","description":"Official repository for Spyder - The Scientific PYthon Development EnviRonment","fork":true,"url":"https://api.github.com/repos/goanpeca/spyder","forks_url":"https://api.github.com/repos/goanpeca/spyder/forks","keys_url":"https://api.github.com/repos/goanpeca/spyder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goanpeca/spyder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goanpeca/spyder/teams","hooks_url":"https://api.github.com/repos/goanpeca/spyder/hooks","issue_events_url":"https://api.github.com/repos/goanpeca/spyder/issues/events{/number}","events_url":"https://api.github.com/repos/goanpeca/spyder/events","assignees_url":"https://api.github.com/repos/goanpeca/spyder/assignees{/user}","branches_url":"https://api.github.com/repos/goanpeca/spyder/branches{/branch}","tags_url":"https://api.github.com/repos/goanpeca/spyder/tags","blobs_url":"https://api.github.com/repos/goanpeca/spyder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goanpeca/spyder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goanpeca/spyder/git/refs{/sha}","trees_url":"https://api.github.com/repos/goanpeca/spyder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goanpeca/spyder/statuses/{sha}","languages_url":"https://api.github.com/repos/goanpeca/spyder/languages","stargazers_url":"https://api.github.com/repos/goanpeca/spyder/stargazers","contributors_url":"https://api.github.com/repos/goanpeca/spyder/contributors","subscribers_url":"https://api.github.com/repos/goanpeca/spyder/subscribers","subscription_url":"https://api.github.com/repos/goanpeca/spyder/subscription","commits_url":"https://api.github.com/repos/goanpeca/spyder/commits{/sha}","git_commits_url":"https://api.github.com/repos/goanpeca/spyder/git/commits{/sha}","comments_url":"https://api.github.com/repos/goanpeca/spyder/comments{/number}","issue_comment_url":"https://api.github.com/repos/goanpeca/spyder/issues/comments{/number}","contents_url":"https://api.github.com/repos/goanpeca/spyder/contents/{+path}","compare_url":"https://api.github.com/repos/goanpeca/spyder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goanpeca/spyder/merges","archive_url":"https://api.github.com/repos/goanpeca/spyder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goanpeca/spyder/downloads","issues_url":"https://api.github.com/repos/goanpeca/spyder/issues{/number}","pulls_url":"https://api.github.com/repos/goanpeca/spyder/pulls{/number}","milestones_url":"https://api.github.com/repos/goanpeca/spyder/milestones{/number}","notifications_url":"https://api.github.com/repos/goanpeca/spyder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goanpeca/spyder/labels{/name}","releases_url":"https://api.github.com/repos/goanpeca/spyder/releases{/id}","deployments_url":"https://api.github.com/repos/goanpeca/spyder/deployments","created_at":"2015-02-20T21:13:25Z","updated_at":"2016-01-18T01:22:04Z","pushed_at":"2016-04-27T15:59:31Z","git_url":"git://github.com/goanpeca/spyder.git","ssh_url":"git@github.com:goanpeca/spyder.git","clone_url":"https://github.com/goanpeca/spyder.git","svn_url":"https://github.com/goanpeca/spyder","homepage":"","size":29250,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spyder-ide:master","ref":"master","sha":"eb840fe0ec33a1fcf53093cab63aada4139063eb","user":{"login":"spyder-ide","id":1284937,"avatar_url":"https://avatars.githubusercontent.com/u/1284937?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-ide","html_url":"https://github.com/spyder-ide","followers_url":"https://api.github.com/users/spyder-ide/followers","following_url":"https://api.github.com/users/spyder-ide/following{/other_user}","gists_url":"https://api.github.com/users/spyder-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-ide/subscriptions","organizations_url":"https://api.github.com/users/spyder-ide/orgs","repos_url":"https://api.github.com/users/spyder-ide/repos","events_url":"https://api.github.com/users/spyder-ide/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-ide/received_events","type":"Organization","site_admin":false},"repo":{"id":30892477,"name":"spyder","full_name":"spyder-ide/spyder","owner":{"login":"spyder-ide","id":1284937,"avatar_url":"https://avatars.githubusercontent.com/u/1284937?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-ide","html_url":"https://github.com/spyder-ide","followers_url":"https://api.github.com/users/spyder-ide/followers","following_url":"https://api.github.com/users/spyder-ide/following{/other_user}","gists_url":"https://api.github.com/users/spyder-ide/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-ide/subscriptions","organizations_url":"https://api.github.com/users/spyder-ide/orgs","repos_url":"https://api.github.com/users/spyder-ide/repos","events_url":"https://api.github.com/users/spyder-ide/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-ide/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spyder-ide/spyder","description":"Official repository for Spyder - The Scientific PYthon Development EnviRonment","fork":false,"url":"https://api.github.com/repos/spyder-ide/spyder","forks_url":"https://api.github.com/repos/spyder-ide/spyder/forks","keys_url":"https://api.github.com/repos/spyder-ide/spyder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spyder-ide/spyder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spyder-ide/spyder/teams","hooks_url":"https://api.github.com/repos/spyder-ide/spyder/hooks","issue_events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/events{/number}","events_url":"https://api.github.com/repos/spyder-ide/spyder/events","assignees_url":"https://api.github.com/repos/spyder-ide/spyder/assignees{/user}","branches_url":"https://api.github.com/repos/spyder-ide/spyder/branches{/branch}","tags_url":"https://api.github.com/repos/spyder-ide/spyder/tags","blobs_url":"https://api.github.com/repos/spyder-ide/spyder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spyder-ide/spyder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spyder-ide/spyder/git/refs{/sha}","trees_url":"https://api.github.com/repos/spyder-ide/spyder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spyder-ide/spyder/statuses/{sha}","languages_url":"https://api.github.com/repos/spyder-ide/spyder/languages","stargazers_url":"https://api.github.com/repos/spyder-ide/spyder/stargazers","contributors_url":"https://api.github.com/repos/spyder-ide/spyder/contributors","subscribers_url":"https://api.github.com/repos/spyder-ide/spyder/subscribers","subscription_url":"https://api.github.com/repos/spyder-ide/spyder/subscription","commits_url":"https://api.github.com/repos/spyder-ide/spyder/commits{/sha}","git_commits_url":"https://api.github.com/repos/spyder-ide/spyder/git/commits{/sha}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/comments{/number}","issue_comment_url":"https://api.github.com/repos/spyder-ide/spyder/issues/comments{/number}","contents_url":"https://api.github.com/repos/spyder-ide/spyder/contents/{+path}","compare_url":"https://api.github.com/repos/spyder-ide/spyder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spyder-ide/spyder/merges","archive_url":"https://api.github.com/repos/spyder-ide/spyder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spyder-ide/spyder/downloads","issues_url":"https://api.github.com/repos/spyder-ide/spyder/issues{/number}","pulls_url":"https://api.github.com/repos/spyder-ide/spyder/pulls{/number}","milestones_url":"https://api.github.com/repos/spyder-ide/spyder/milestones{/number}","notifications_url":"https://api.github.com/repos/spyder-ide/spyder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spyder-ide/spyder/labels{/name}","releases_url":"https://api.github.com/repos/spyder-ide/spyder/releases{/id}","deployments_url":"https://api.github.com/repos/spyder-ide/spyder/deployments","created_at":"2015-02-16T22:49:48Z","updated_at":"2016-05-12T04:57:02Z","pushed_at":"2016-05-10T11:50:55Z","git_url":"git://github.com/spyder-ide/spyder.git","ssh_url":"git@github.com:spyder-ide/spyder.git","clone_url":"https://github.com/spyder-ide/spyder.git","svn_url":"https://github.com/spyder-ide/spyder","homepage":"","size":65117,"stargazers_count":1053,"watchers_count":1053,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":259,"mirror_url":null,"open_issues_count":656,"forks":259,"open_issues":656,"watchers":1053,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120"},"html":{"href":"https://github.com/spyder-ide/spyder/pull/3120"},"issue":{"href":"https://api.github.com/repos/spyder-ide/spyder/issues/3120"},"comments":{"href":"https://api.github.com/repos/spyder-ide/spyder/issues/3120/comments"},"review_comments":{"href":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120/comments"},"review_comment":{"href":"https://api.github.com/repos/spyder-ide/spyder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spyder-ide/spyder/pulls/3120/commits"},"statuses":{"href":"https://api.github.com/repos/spyder-ide/spyder/statuses/fcfbf8ba42f3e0921dcb782dd08c284869ad1ed4"}}}}