{"action":"created","comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments/168627058","pull_request_review_id":97023283,"id":168627058,"diff_hunk":"@@ -603,3 +603,116 @@ def test_foo_4():\n         result = testdir.runpytest('--last-failed')\n         result.stdout.fnmatch_lines('*4 passed*')\n         assert self.get_cached_last_failed(testdir) == []\n+\n+\n+class TestNewFirst(object):\n+    def test_newfirst_usecase(self, testdir):\n+        t1 = testdir.mkdir(\"test_1\")","path":"testing/test_cacheprovider.py","position":36,"original_position":36,"commit_id":"dff0500114971b30a7bb9043acb0d0fb6a9e01c4","original_commit_id":"dff0500114971b30a7bb9043acb0d0fb6a9e01c4","user":{"login":"nicoddemus","id":1085180,"avatar_url":"https://avatars2.githubusercontent.com/u/1085180?v=4","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":"You can write those files more easily with `makepyfile`:\r\n\r\n```python\r\ntestdir.makepyfile(**{\r\n    'test_1/test_1.py': '''\r\n        def test_1(): assert 1\r\n        def test_2(): assert 1\r\n        def test_3(): assert 1\r\n    ''',\r\n    'test_1/test_2.py': '''\r\n        def test_1(): assert 1\r\n        def test_2(): assert 1\r\n        def test_3(): assert 1\r\n    ''' \r\n})\r\n```","created_at":"2018-02-15T22:23:18Z","updated_at":"2018-02-15T22:33:42Z","html_url":"https://github.com/pytest-dev/pytest/pull/3218#discussion_r168627058","pull_request_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments/168627058"},"html":{"href":"https://github.com/pytest-dev/pytest/pull/3218#discussion_r168627058"},"pull_request":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218"}}},"pull_request":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218","id":168942122,"html_url":"https://github.com/pytest-dev/pytest/pull/3218","diff_url":"https://github.com/pytest-dev/pytest/pull/3218.diff","patch_url":"https://github.com/pytest-dev/pytest/pull/3218.patch","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3218","number":3218,"state":"open","locked":false,"title":"#3034 Added new option \"--new-first\"","user":{"login":"feuillemorte","id":9434344,"avatar_url":"https://avatars0.githubusercontent.com/u/9434344?v=4","gravatar_id":"","url":"https://api.github.com/users/feuillemorte","html_url":"https://github.com/feuillemorte","followers_url":"https://api.github.com/users/feuillemorte/followers","following_url":"https://api.github.com/users/feuillemorte/following{/other_user}","gists_url":"https://api.github.com/users/feuillemorte/gists{/gist_id}","starred_url":"https://api.github.com/users/feuillemorte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feuillemorte/subscriptions","organizations_url":"https://api.github.com/users/feuillemorte/orgs","repos_url":"https://api.github.com/users/feuillemorte/repos","events_url":"https://api.github.com/users/feuillemorte/events{/privacy}","received_events_url":"https://api.github.com/users/feuillemorte/received_events","type":"User","site_admin":false},"body":"Fixes #3034\r\nAdded new option --new-first\r\n\r\nHow it works:\r\nCreate different test files:\r\ntests\r\n|- test_one.py\r\n\\- test_two.py\r\n\r\nEvery file contains two tests:\r\n```\r\ndef test_1():\r\n    assert 1\r\n\r\ndef test_2():\r\n    assert 1\r\n```\r\n\r\nrun command \r\n```\r\npytest tests -v\r\n```\r\nresult:\r\n```\r\ntests/test_one.py::test_1 PASSED\r\ntests/test_one.py::test_2 PASSED\r\ntests/test_two.py::test_1 PASSED\r\ntests/test_two.py::test_2 PASSED\r\n```\r\n\r\nrun command \r\n```\r\npytest tests -v --nf\r\n```\r\nresult:\r\n```\r\ntests/test_two.py::test_1 PASSED\r\ntests/test_two.py::test_2 PASSED\r\ntests/test_one.py::test_1 PASSED\r\ntests/test_one.py::test_2 PASSED\r\n```\r\nOrder changed to modifyed files first\r\n\r\nAdd new test to test_two.py file and then modify test_one.py file\r\n\r\nrun command \r\n```\r\npytest tests -v --nf\r\n```\r\nresult:\r\n```\r\ntests/test_two.py::test_3 PASSED\r\ntests/test_one.py::test_1 PASSED\r\ntests/test_one.py::test_2 PASSED\r\ntests/test_two.py::test_1 PASSED\r\ntests/test_two.py::test_2 PASSED\r\n```\r\nOrder changed: first new test, then modified files","created_at":"2018-02-13T20:02:01Z","updated_at":"2018-02-15T22:33:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d42526e306721fcd5f39057710fec10c100ff8b4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218/commits","review_comments_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218/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/3218/comments","statuses_url":"https://api.github.com/repos/pytest-dev/pytest/statuses/dff0500114971b30a7bb9043acb0d0fb6a9e01c4","head":{"label":"feuillemorte:3034-new-tests-first","ref":"3034-new-tests-first","sha":"dff0500114971b30a7bb9043acb0d0fb6a9e01c4","user":{"login":"feuillemorte","id":9434344,"avatar_url":"https://avatars0.githubusercontent.com/u/9434344?v=4","gravatar_id":"","url":"https://api.github.com/users/feuillemorte","html_url":"https://github.com/feuillemorte","followers_url":"https://api.github.com/users/feuillemorte/followers","following_url":"https://api.github.com/users/feuillemorte/following{/other_user}","gists_url":"https://api.github.com/users/feuillemorte/gists{/gist_id}","starred_url":"https://api.github.com/users/feuillemorte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feuillemorte/subscriptions","organizations_url":"https://api.github.com/users/feuillemorte/orgs","repos_url":"https://api.github.com/users/feuillemorte/repos","events_url":"https://api.github.com/users/feuillemorte/events{/privacy}","received_events_url":"https://api.github.com/users/feuillemorte/received_events","type":"User","site_admin":false},"repo":{"id":117699446,"name":"pytest","full_name":"feuillemorte/pytest","owner":{"login":"feuillemorte","id":9434344,"avatar_url":"https://avatars0.githubusercontent.com/u/9434344?v=4","gravatar_id":"","url":"https://api.github.com/users/feuillemorte","html_url":"https://github.com/feuillemorte","followers_url":"https://api.github.com/users/feuillemorte/followers","following_url":"https://api.github.com/users/feuillemorte/following{/other_user}","gists_url":"https://api.github.com/users/feuillemorte/gists{/gist_id}","starred_url":"https://api.github.com/users/feuillemorte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feuillemorte/subscriptions","organizations_url":"https://api.github.com/users/feuillemorte/orgs","repos_url":"https://api.github.com/users/feuillemorte/repos","events_url":"https://api.github.com/users/feuillemorte/events{/privacy}","received_events_url":"https://api.github.com/users/feuillemorte/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/feuillemorte/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/feuillemorte/pytest","forks_url":"https://api.github.com/repos/feuillemorte/pytest/forks","keys_url":"https://api.github.com/repos/feuillemorte/pytest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feuillemorte/pytest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feuillemorte/pytest/teams","hooks_url":"https://api.github.com/repos/feuillemorte/pytest/hooks","issue_events_url":"https://api.github.com/repos/feuillemorte/pytest/issues/events{/number}","events_url":"https://api.github.com/repos/feuillemorte/pytest/events","assignees_url":"https://api.github.com/repos/feuillemorte/pytest/assignees{/user}","branches_url":"https://api.github.com/repos/feuillemorte/pytest/branches{/branch}","tags_url":"https://api.github.com/repos/feuillemorte/pytest/tags","blobs_url":"https://api.github.com/repos/feuillemorte/pytest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feuillemorte/pytest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feuillemorte/pytest/git/refs{/sha}","trees_url":"https://api.github.com/repos/feuillemorte/pytest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feuillemorte/pytest/statuses/{sha}","languages_url":"https://api.github.com/repos/feuillemorte/pytest/languages","stargazers_url":"https://api.github.com/repos/feuillemorte/pytest/stargazers","contributors_url":"https://api.github.com/repos/feuillemorte/pytest/contributors","subscribers_url":"https://api.github.com/repos/feuillemorte/pytest/subscribers","subscription_url":"https://api.github.com/repos/feuillemorte/pytest/subscription","commits_url":"https://api.github.com/repos/feuillemorte/pytest/commits{/sha}","git_commits_url":"https://api.github.com/repos/feuillemorte/pytest/git/commits{/sha}","comments_url":"https://api.github.com/repos/feuillemorte/pytest/comments{/number}","issue_comment_url":"https://api.github.com/repos/feuillemorte/pytest/issues/comments{/number}","contents_url":"https://api.github.com/repos/feuillemorte/pytest/contents/{+path}","compare_url":"https://api.github.com/repos/feuillemorte/pytest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feuillemorte/pytest/merges","archive_url":"https://api.github.com/repos/feuillemorte/pytest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feuillemorte/pytest/downloads","issues_url":"https://api.github.com/repos/feuillemorte/pytest/issues{/number}","pulls_url":"https://api.github.com/repos/feuillemorte/pytest/pulls{/number}","milestones_url":"https://api.github.com/repos/feuillemorte/pytest/milestones{/number}","notifications_url":"https://api.github.com/repos/feuillemorte/pytest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feuillemorte/pytest/labels{/name}","releases_url":"https://api.github.com/repos/feuillemorte/pytest/releases{/id}","deployments_url":"https://api.github.com/repos/feuillemorte/pytest/deployments","created_at":"2018-01-16T15:10:45Z","updated_at":"2018-01-16T15:10:49Z","pushed_at":"2018-02-13T19:49:56Z","git_url":"git://github.com/feuillemorte/pytest.git","ssh_url":"git@github.com:feuillemorte/pytest.git","clone_url":"https://github.com/feuillemorte/pytest.git","svn_url":"https://github.com/feuillemorte/pytest","homepage":"http://pytest.org/","size":11468,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytest-dev:features","ref":"features","sha":"063e2da967a715b06b912586ba7eb50464984ac7","user":{"login":"pytest-dev","id":8897583,"avatar_url":"https://avatars2.githubusercontent.com/u/8897583?v=4","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://avatars2.githubusercontent.com/u/8897583?v=4","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":"2018-02-15T03:45:35Z","pushed_at":"2018-02-15T22:08:21Z","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":11486,"stargazers_count":2237,"watchers_count":2237,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":573,"mirror_url":null,"archived":false,"open_issues_count":448,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":573,"open_issues":448,"watchers":2237,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218"},"html":{"href":"https://github.com/pytest-dev/pytest/pull/3218"},"issue":{"href":"https://api.github.com/repos/pytest-dev/pytest/issues/3218"},"comments":{"href":"https://api.github.com/repos/pytest-dev/pytest/issues/3218/comments"},"review_comments":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/3218/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/3218/commits"},"statuses":{"href":"https://api.github.com/repos/pytest-dev/pytest/statuses/dff0500114971b30a7bb9043acb0d0fb6a9e01c4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nicoddemus"}}