{"action":"created","comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments/71972509","id":71972509,"diff_hunk":"@@ -475,6 +475,85 @@ def foo():\n                                     \"--junit-xml=junit.xml\")\n         reprec.assertoutcome(failed=1)\n \n+    def _run_doctest_report(self, testdir, format):\n+        testdir.makepyfile(\"\"\"\n+            def foo():\n+                '''\n+                >>> foo()\n+                   a  b\n+                0  1  4\n+                1  2  4\n+                2  3  6\n+                '''\n+                print('   a  b\\\\n'\n+                      '0  1  4\\\\n'\n+                      '1  2  5\\\\n'\n+                      '2  3  6')\n+            \"\"\")\n+        return testdir.runpytest(\"--doctest-modules\", \"--doctest-report\", format)\n+\n+    def test_doctest_report_udiff(self, testdir, format='udiff'):\n+        result = self._run_doctest_report(testdir, format)\n+        result.stdout.fnmatch_lines([\n+            '     0  1  4',\n+            '    -1  2  4',\n+            '    +1  2  5',\n+            '     2  3  6',\n+        ])\n+\n+    def test_doctest_report_cdiff(self, testdir):\n+        result = self._run_doctest_report(testdir, 'cdiff')\n+        result.stdout.fnmatch_lines([\n+            '         a  b',\n+            '      0  1  4',\n+            '    ! 1  2  4',\n+            '      2  3  6',\n+            '    --- 1,4 ----',\n+            '         a  b',\n+            '      0  1  4',\n+            '    ! 1  2  5',\n+            '      2  3  6',\n+        ])\n+\n+    def test_doctest_report_ndiff(self, testdir):\n+        result = self._run_doctest_report(testdir, 'ndiff')\n+        result.stdout.fnmatch_lines([\n+            '         a  b',\n+            '      0  1  4',\n+            '    - 1  2  4',\n+            '    ?       ^',\n+            '    + 1  2  5',\n+            '    ?       ^',\n+            '      2  3  6',\n+        ])\n+\n+    def test_doctest_report_none_or_only_first_failure(self, testdir):","path":"testing/test_doctest.py","position":60,"original_position":56,"commit_id":"f8f690de6417b1faa0b6e7a820fff0b5b19144c6","original_commit_id":"014ebc9202b784e9b66cc8d61aca2faec8511198","user":{"login":"nicoddemus","id":1085180,"avatar_url":"https://avatars.githubusercontent.com/u/1085180?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoddemus","html_url":"https://github.com/nicoddemus","followers_url":"https://api.github.com/users/nicoddemus/followers","following_url":"https://api.github.com/users/nicoddemus/following{/other_user}","gists_url":"https://api.github.com/users/nicoddemus/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoddemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoddemus/subscriptions","organizations_url":"https://api.github.com/users/nicoddemus/orgs","repos_url":"https://api.github.com/users/nicoddemus/repos","events_url":"https://api.github.com/users/nicoddemus/events{/privacy}","received_events_url":"https://api.github.com/users/nicoddemus/received_events","type":"User","site_admin":false},"body":"e229a27 was about `test_doctest_report_udiff` correct? I mean here that you can avoid the inner loop and use `parametrize` in here as well:\r\n\r\n```python\r\n@pytest.mark.parametrize('format', ['none', 'only_first_failure'])\r\ndef test_doctest_report_none_or_only_first_failure(self, testdir):    \r\n    result = self._run_doctest_report(testdir, format)\r\n    result.stdout.fnmatch_lines([\r\n        'Expected:',\r\n        '       a  b',\r\n        '    0  1  4',\r\n        '    1  2  4',\r\n        '    2  3  6',\r\n        'Got:',\r\n        '       a  b',\r\n        '    0  1  4',\r\n        '    1  2  5',\r\n        '    2  3  6',\r\n    ])\r\n```","created_at":"2016-07-23T13:30:41Z","updated_at":"2016-07-23T13:30:41Z","html_url":"https://github.com/pytest-dev/pytest/pull/1754#discussion_r71972509","pull_request_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754","_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments/71972509"},"html":{"href":"https://github.com/pytest-dev/pytest/pull/1754#discussion_r71972509"},"pull_request":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754"}}},"pull_request":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754","id":78571585,"html_url":"https://github.com/pytest-dev/pytest/pull/1754","diff_url":"https://github.com/pytest-dev/pytest/pull/1754.diff","patch_url":"https://github.com/pytest-dev/pytest/pull/1754.patch","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1754","number":1754,"state":"open","locked":false,"title":"Doctest report format option (#1749)","user":{"login":"hartym","id":30586,"avatar_url":"https://avatars.githubusercontent.com/u/30586?v=3","gravatar_id":"","url":"https://api.github.com/users/hartym","html_url":"https://github.com/hartym","followers_url":"https://api.github.com/users/hartym/followers","following_url":"https://api.github.com/users/hartym/following{/other_user}","gists_url":"https://api.github.com/users/hartym/gists{/gist_id}","starred_url":"https://api.github.com/users/hartym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartym/subscriptions","organizations_url":"https://api.github.com/users/hartym/orgs","repos_url":"https://api.github.com/users/hartym/repos","events_url":"https://api.github.com/users/hartym/events{/privacy}","received_events_url":"https://api.github.com/users/hartym/received_events","type":"User","site_admin":false},"body":"Here is a first pull request, as it is my first contribution, I may have done incorrect things according to pytest standards, please let me know whatever I should do more or differently.\r\n\r\n- [x] Target: for bug or doc fixes, target `master`; for new features, target `features`\r\n- [x] Make sure to include one or more tests for your change\r\n- [x] Add yourself to `AUTHORS`\r\n- [x] Add a new entry to the `CHANGELOG` (choose any open position to avoid merge conflicts with other PRs) \r\n","created_at":"2016-07-23T12:53:43Z","updated_at":"2016-07-23T13:30:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de62c2769e0a26a7837fa6d598d01fd9c2013a3a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754/commits","review_comments_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754/comments","review_comment_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1754/comments","statuses_url":"https://api.github.com/repos/pytest-dev/pytest/statuses/f8f690de6417b1faa0b6e7a820fff0b5b19144c6","head":{"label":"hartym:1749_doctest_report_format","ref":"1749_doctest_report_format","sha":"f8f690de6417b1faa0b6e7a820fff0b5b19144c6","user":{"login":"hartym","id":30586,"avatar_url":"https://avatars.githubusercontent.com/u/30586?v=3","gravatar_id":"","url":"https://api.github.com/users/hartym","html_url":"https://github.com/hartym","followers_url":"https://api.github.com/users/hartym/followers","following_url":"https://api.github.com/users/hartym/following{/other_user}","gists_url":"https://api.github.com/users/hartym/gists{/gist_id}","starred_url":"https://api.github.com/users/hartym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartym/subscriptions","organizations_url":"https://api.github.com/users/hartym/orgs","repos_url":"https://api.github.com/users/hartym/repos","events_url":"https://api.github.com/users/hartym/events{/privacy}","received_events_url":"https://api.github.com/users/hartym/received_events","type":"User","site_admin":false},"repo":{"id":64006708,"name":"pytest","full_name":"hartym/pytest","owner":{"login":"hartym","id":30586,"avatar_url":"https://avatars.githubusercontent.com/u/30586?v=3","gravatar_id":"","url":"https://api.github.com/users/hartym","html_url":"https://github.com/hartym","followers_url":"https://api.github.com/users/hartym/followers","following_url":"https://api.github.com/users/hartym/following{/other_user}","gists_url":"https://api.github.com/users/hartym/gists{/gist_id}","starred_url":"https://api.github.com/users/hartym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartym/subscriptions","organizations_url":"https://api.github.com/users/hartym/orgs","repos_url":"https://api.github.com/users/hartym/repos","events_url":"https://api.github.com/users/hartym/events{/privacy}","received_events_url":"https://api.github.com/users/hartym/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hartym/pytest","description":"The pytest framework makes it easy to write small tests, yet scales to support complex functional testing","fork":true,"url":"https://api.github.com/repos/hartym/pytest","forks_url":"https://api.github.com/repos/hartym/pytest/forks","keys_url":"https://api.github.com/repos/hartym/pytest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hartym/pytest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hartym/pytest/teams","hooks_url":"https://api.github.com/repos/hartym/pytest/hooks","issue_events_url":"https://api.github.com/repos/hartym/pytest/issues/events{/number}","events_url":"https://api.github.com/repos/hartym/pytest/events","assignees_url":"https://api.github.com/repos/hartym/pytest/assignees{/user}","branches_url":"https://api.github.com/repos/hartym/pytest/branches{/branch}","tags_url":"https://api.github.com/repos/hartym/pytest/tags","blobs_url":"https://api.github.com/repos/hartym/pytest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hartym/pytest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hartym/pytest/git/refs{/sha}","trees_url":"https://api.github.com/repos/hartym/pytest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hartym/pytest/statuses/{sha}","languages_url":"https://api.github.com/repos/hartym/pytest/languages","stargazers_url":"https://api.github.com/repos/hartym/pytest/stargazers","contributors_url":"https://api.github.com/repos/hartym/pytest/contributors","subscribers_url":"https://api.github.com/repos/hartym/pytest/subscribers","subscription_url":"https://api.github.com/repos/hartym/pytest/subscription","commits_url":"https://api.github.com/repos/hartym/pytest/commits{/sha}","git_commits_url":"https://api.github.com/repos/hartym/pytest/git/commits{/sha}","comments_url":"https://api.github.com/repos/hartym/pytest/comments{/number}","issue_comment_url":"https://api.github.com/repos/hartym/pytest/issues/comments{/number}","contents_url":"https://api.github.com/repos/hartym/pytest/contents/{+path}","compare_url":"https://api.github.com/repos/hartym/pytest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hartym/pytest/merges","archive_url":"https://api.github.com/repos/hartym/pytest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hartym/pytest/downloads","issues_url":"https://api.github.com/repos/hartym/pytest/issues{/number}","pulls_url":"https://api.github.com/repos/hartym/pytest/pulls{/number}","milestones_url":"https://api.github.com/repos/hartym/pytest/milestones{/number}","notifications_url":"https://api.github.com/repos/hartym/pytest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hartym/pytest/labels{/name}","releases_url":"https://api.github.com/repos/hartym/pytest/releases{/id}","deployments_url":"https://api.github.com/repos/hartym/pytest/deployments","created_at":"2016-07-23T08:22:06Z","updated_at":"2016-07-23T08:22:08Z","pushed_at":"2016-07-23T13:30:13Z","git_url":"git://github.com/hartym/pytest.git","ssh_url":"git@github.com:hartym/pytest.git","clone_url":"https://github.com/hartym/pytest.git","svn_url":"https://github.com/hartym/pytest","homepage":"http://pytest.org/","size":8477,"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":"pytest-dev:features","ref":"features","sha":"ae0798522fda6ea8f6d1120ec33b16edde12b8e3","user":{"login":"pytest-dev","id":8897583,"avatar_url":"https://avatars.githubusercontent.com/u/8897583?v=3","gravatar_id":"","url":"https://api.github.com/users/pytest-dev","html_url":"https://github.com/pytest-dev","followers_url":"https://api.github.com/users/pytest-dev/followers","following_url":"https://api.github.com/users/pytest-dev/following{/other_user}","gists_url":"https://api.github.com/users/pytest-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pytest-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytest-dev/subscriptions","organizations_url":"https://api.github.com/users/pytest-dev/orgs","repos_url":"https://api.github.com/users/pytest-dev/repos","events_url":"https://api.github.com/users/pytest-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pytest-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":37489525,"name":"pytest","full_name":"pytest-dev/pytest","owner":{"login":"pytest-dev","id":8897583,"avatar_url":"https://avatars.githubusercontent.com/u/8897583?v=3","gravatar_id":"","url":"https://api.github.com/users/pytest-dev","html_url":"https://github.com/pytest-dev","followers_url":"https://api.github.com/users/pytest-dev/followers","following_url":"https://api.github.com/users/pytest-dev/following{/other_user}","gists_url":"https://api.github.com/users/pytest-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pytest-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytest-dev/subscriptions","organizations_url":"https://api.github.com/users/pytest-dev/orgs","repos_url":"https://api.github.com/users/pytest-dev/repos","events_url":"https://api.github.com/users/pytest-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pytest-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pytest-dev/pytest","description":"The pytest framework makes it easy to write small tests, yet scales to support complex functional testing","fork":false,"url":"https://api.github.com/repos/pytest-dev/pytest","forks_url":"https://api.github.com/repos/pytest-dev/pytest/forks","keys_url":"https://api.github.com/repos/pytest-dev/pytest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytest-dev/pytest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytest-dev/pytest/teams","hooks_url":"https://api.github.com/repos/pytest-dev/pytest/hooks","issue_events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/events{/number}","events_url":"https://api.github.com/repos/pytest-dev/pytest/events","assignees_url":"https://api.github.com/repos/pytest-dev/pytest/assignees{/user}","branches_url":"https://api.github.com/repos/pytest-dev/pytest/branches{/branch}","tags_url":"https://api.github.com/repos/pytest-dev/pytest/tags","blobs_url":"https://api.github.com/repos/pytest-dev/pytest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytest-dev/pytest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytest-dev/pytest/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytest-dev/pytest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytest-dev/pytest/statuses/{sha}","languages_url":"https://api.github.com/repos/pytest-dev/pytest/languages","stargazers_url":"https://api.github.com/repos/pytest-dev/pytest/stargazers","contributors_url":"https://api.github.com/repos/pytest-dev/pytest/contributors","subscribers_url":"https://api.github.com/repos/pytest-dev/pytest/subscribers","subscription_url":"https://api.github.com/repos/pytest-dev/pytest/subscription","commits_url":"https://api.github.com/repos/pytest-dev/pytest/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytest-dev/pytest/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytest-dev/pytest/contents/{+path}","compare_url":"https://api.github.com/repos/pytest-dev/pytest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytest-dev/pytest/merges","archive_url":"https://api.github.com/repos/pytest-dev/pytest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytest-dev/pytest/downloads","issues_url":"https://api.github.com/repos/pytest-dev/pytest/issues{/number}","pulls_url":"https://api.github.com/repos/pytest-dev/pytest/pulls{/number}","milestones_url":"https://api.github.com/repos/pytest-dev/pytest/milestones{/number}","notifications_url":"https://api.github.com/repos/pytest-dev/pytest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytest-dev/pytest/labels{/name}","releases_url":"https://api.github.com/repos/pytest-dev/pytest/releases{/id}","deployments_url":"https://api.github.com/repos/pytest-dev/pytest/deployments","created_at":"2015-06-15T20:28:27Z","updated_at":"2016-07-22T09:34:01Z","pushed_at":"2016-07-23T13:30:13Z","git_url":"git://github.com/pytest-dev/pytest.git","ssh_url":"git@github.com:pytest-dev/pytest.git","clone_url":"https://github.com/pytest-dev/pytest.git","svn_url":"https://github.com/pytest-dev/pytest","homepage":"http://pytest.org/","size":10472,"stargazers_count":792,"watchers_count":792,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":217,"mirror_url":null,"open_issues_count":290,"forks":217,"open_issues":290,"watchers":792,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754"},"html":{"href":"https://github.com/pytest-dev/pytest/pull/1754"},"issue":{"href":"https://api.github.com/repos/pytest-dev/pytest/issues/1754"},"comments":{"href":"https://api.github.com/repos/pytest-dev/pytest/issues/1754/comments"},"review_comments":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754/comments"},"review_comment":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/1754/commits"},"statuses":{"href":"https://api.github.com/repos/pytest-dev/pytest/statuses/f8f690de6417b1faa0b6e7a820fff0b5b19144c6"}}}}
{"actor":{"display_login":"nicoddemus"}}