{"action":"created","comment":{"url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/comments/85120404","pull_request_review_id":5853572,"id":85120404,"diff_hunk":"@@ -125,3 +125,54 @@ def test_record_performance_file_name(self):\n         perf_name = __file__.replace('.py', '.file_name.perf.yml')\n         with self.record_performance(file_name=perf_name):\n             caches['default'].get('foo')\n+\n+\n+class FileNameTests(TestCase):\n+\n+    default_perf_name = __file__.replace('.py', '.perf.yml')\n+    custom_perf_name = 'custom.perf.yml'\n+    custom_path_perf_name = os.path.join(\n+        os.path.dirname(__file__),\n+        'performance_tests',\n+        os.path.basename(__file__).replace('.py', '.perf.yml')\n+    )\n+\n+    def setUp(self):\n+        super(FileNameTests, self).setUp()\n+        self.ensure_no_file()\n+\n+    def tearDown(self):\n+        self.ensure_no_file()\n+        super(FileNameTests, self).tearDown()\n+\n+    def ensure_no_file(self):\n+        for name in (self.custom_perf_name, self.custom_path_perf_name):\n+            try:\n+                os.unlink(name)\n+            except OSError as exc:\n+                if exc.errno != errno.ENOENT:\n+                    raise\n+\n+        try:\n+            os.rmdir(os.path.dirname(self.custom_path_perf_name))\n+        except OSError as exc:\n+            if exc.errno != errno.ENOENT:\n+                raise\n+\n+    def test_default_filename(self):\n+        with record():\n+            caches['default'].get('foo')\n+\n+        assert(os.path.exists(self.default_perf_name))","path":"tests/test_api.py","position":42,"original_position":42,"commit_id":"262020e03c05760d11257ded021b384b367b1510","original_commit_id":"262020e03c05760d11257ded021b384b367b1510","user":{"login":"adamchainz","id":857609,"avatar_url":"https://avatars.githubusercontent.com/u/857609?v=3","gravatar_id":"","url":"https://api.github.com/users/adamchainz","html_url":"https://github.com/adamchainz","followers_url":"https://api.github.com/users/adamchainz/followers","following_url":"https://api.github.com/users/adamchainz/following{/other_user}","gists_url":"https://api.github.com/users/adamchainz/gists{/gist_id}","starred_url":"https://api.github.com/users/adamchainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamchainz/subscriptions","organizations_url":"https://api.github.com/users/adamchainz/orgs","repos_url":"https://api.github.com/users/adamchainz/repos","events_url":"https://api.github.com/users/adamchainz/events{/privacy}","received_events_url":"https://api.github.com/users/adamchainz/received_events","type":"User","site_admin":false},"body":"No worries, it can just get a bit confusing.","created_at":"2016-10-26T13:24:49Z","updated_at":"2016-10-26T13:24:49Z","html_url":"https://github.com/YPlan/django-perf-rec/pull/27#discussion_r85120404","pull_request_url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/comments/85120404"},"html":{"href":"https://github.com/YPlan/django-perf-rec/pull/27#discussion_r85120404"},"pull_request":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27","id":90763423,"html_url":"https://github.com/YPlan/django-perf-rec/pull/27","diff_url":"https://github.com/YPlan/django-perf-rec/pull/27.diff","patch_url":"https://github.com/YPlan/django-perf-rec/pull/27.patch","issue_url":"https://api.github.com/repos/YPlan/django-perf-rec/issues/27","number":27,"state":"closed","locked":false,"title":"Enable setting custom path for performance files","user":{"login":"njoyard","id":127842,"avatar_url":"https://avatars.githubusercontent.com/u/127842?v=3","gravatar_id":"","url":"https://api.github.com/users/njoyard","html_url":"https://github.com/njoyard","followers_url":"https://api.github.com/users/njoyard/followers","following_url":"https://api.github.com/users/njoyard/following{/other_user}","gists_url":"https://api.github.com/users/njoyard/gists{/gist_id}","starred_url":"https://api.github.com/users/njoyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njoyard/subscriptions","organizations_url":"https://api.github.com/users/njoyard/orgs","repos_url":"https://api.github.com/users/njoyard/repos","events_url":"https://api.github.com/users/njoyard/events{/privacy}","received_events_url":"https://api.github.com/users/njoyard/received_events","type":"User","site_admin":false},"body":"This PR enables setting a custom path for performance files.\r\n\r\nUsage:\r\n```python\r\nwith record(path='performance_files'):\r\n    # ...\r\n\r\nwith self.record_performance(path='performance_files'):\r\n    # ...\r\n```\r\n\r\nIncludes tests & documentation.","created_at":"2016-10-25T08:47:53Z","updated_at":"2016-10-26T13:24:49Z","closed_at":"2016-10-26T12:51:18Z","merged_at":null,"merge_commit_sha":"732c36c50110da2941b91152c658792cead76c13","assignee":{"login":"adamchainz","id":857609,"avatar_url":"https://avatars.githubusercontent.com/u/857609?v=3","gravatar_id":"","url":"https://api.github.com/users/adamchainz","html_url":"https://github.com/adamchainz","followers_url":"https://api.github.com/users/adamchainz/followers","following_url":"https://api.github.com/users/adamchainz/following{/other_user}","gists_url":"https://api.github.com/users/adamchainz/gists{/gist_id}","starred_url":"https://api.github.com/users/adamchainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamchainz/subscriptions","organizations_url":"https://api.github.com/users/adamchainz/orgs","repos_url":"https://api.github.com/users/adamchainz/repos","events_url":"https://api.github.com/users/adamchainz/events{/privacy}","received_events_url":"https://api.github.com/users/adamchainz/received_events","type":"User","site_admin":false},"assignees":[{"login":"adamchainz","id":857609,"avatar_url":"https://avatars.githubusercontent.com/u/857609?v=3","gravatar_id":"","url":"https://api.github.com/users/adamchainz","html_url":"https://github.com/adamchainz","followers_url":"https://api.github.com/users/adamchainz/followers","following_url":"https://api.github.com/users/adamchainz/following{/other_user}","gists_url":"https://api.github.com/users/adamchainz/gists{/gist_id}","starred_url":"https://api.github.com/users/adamchainz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamchainz/subscriptions","organizations_url":"https://api.github.com/users/adamchainz/orgs","repos_url":"https://api.github.com/users/adamchainz/repos","events_url":"https://api.github.com/users/adamchainz/events{/privacy}","received_events_url":"https://api.github.com/users/adamchainz/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27/commits","review_comments_url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27/comments","review_comment_url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/YPlan/django-perf-rec/issues/27/comments","statuses_url":"https://api.github.com/repos/YPlan/django-perf-rec/statuses/262020e03c05760d11257ded021b384b367b1510","head":{"label":"njoyard:custom-directory","ref":"custom-directory","sha":"262020e03c05760d11257ded021b384b367b1510","user":{"login":"njoyard","id":127842,"avatar_url":"https://avatars.githubusercontent.com/u/127842?v=3","gravatar_id":"","url":"https://api.github.com/users/njoyard","html_url":"https://github.com/njoyard","followers_url":"https://api.github.com/users/njoyard/followers","following_url":"https://api.github.com/users/njoyard/following{/other_user}","gists_url":"https://api.github.com/users/njoyard/gists{/gist_id}","starred_url":"https://api.github.com/users/njoyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njoyard/subscriptions","organizations_url":"https://api.github.com/users/njoyard/orgs","repos_url":"https://api.github.com/users/njoyard/repos","events_url":"https://api.github.com/users/njoyard/events{/privacy}","received_events_url":"https://api.github.com/users/njoyard/received_events","type":"User","site_admin":false},"repo":{"id":71869644,"name":"django-perf-rec","full_name":"njoyard/django-perf-rec","owner":{"login":"njoyard","id":127842,"avatar_url":"https://avatars.githubusercontent.com/u/127842?v=3","gravatar_id":"","url":"https://api.github.com/users/njoyard","html_url":"https://github.com/njoyard","followers_url":"https://api.github.com/users/njoyard/followers","following_url":"https://api.github.com/users/njoyard/following{/other_user}","gists_url":"https://api.github.com/users/njoyard/gists{/gist_id}","starred_url":"https://api.github.com/users/njoyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njoyard/subscriptions","organizations_url":"https://api.github.com/users/njoyard/orgs","repos_url":"https://api.github.com/users/njoyard/repos","events_url":"https://api.github.com/users/njoyard/events{/privacy}","received_events_url":"https://api.github.com/users/njoyard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/njoyard/django-perf-rec","description":"Keep detailed records of the performance of your Django code.","fork":true,"url":"https://api.github.com/repos/njoyard/django-perf-rec","forks_url":"https://api.github.com/repos/njoyard/django-perf-rec/forks","keys_url":"https://api.github.com/repos/njoyard/django-perf-rec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/njoyard/django-perf-rec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/njoyard/django-perf-rec/teams","hooks_url":"https://api.github.com/repos/njoyard/django-perf-rec/hooks","issue_events_url":"https://api.github.com/repos/njoyard/django-perf-rec/issues/events{/number}","events_url":"https://api.github.com/repos/njoyard/django-perf-rec/events","assignees_url":"https://api.github.com/repos/njoyard/django-perf-rec/assignees{/user}","branches_url":"https://api.github.com/repos/njoyard/django-perf-rec/branches{/branch}","tags_url":"https://api.github.com/repos/njoyard/django-perf-rec/tags","blobs_url":"https://api.github.com/repos/njoyard/django-perf-rec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/njoyard/django-perf-rec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/njoyard/django-perf-rec/git/refs{/sha}","trees_url":"https://api.github.com/repos/njoyard/django-perf-rec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/njoyard/django-perf-rec/statuses/{sha}","languages_url":"https://api.github.com/repos/njoyard/django-perf-rec/languages","stargazers_url":"https://api.github.com/repos/njoyard/django-perf-rec/stargazers","contributors_url":"https://api.github.com/repos/njoyard/django-perf-rec/contributors","subscribers_url":"https://api.github.com/repos/njoyard/django-perf-rec/subscribers","subscription_url":"https://api.github.com/repos/njoyard/django-perf-rec/subscription","commits_url":"https://api.github.com/repos/njoyard/django-perf-rec/commits{/sha}","git_commits_url":"https://api.github.com/repos/njoyard/django-perf-rec/git/commits{/sha}","comments_url":"https://api.github.com/repos/njoyard/django-perf-rec/comments{/number}","issue_comment_url":"https://api.github.com/repos/njoyard/django-perf-rec/issues/comments{/number}","contents_url":"https://api.github.com/repos/njoyard/django-perf-rec/contents/{+path}","compare_url":"https://api.github.com/repos/njoyard/django-perf-rec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/njoyard/django-perf-rec/merges","archive_url":"https://api.github.com/repos/njoyard/django-perf-rec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/njoyard/django-perf-rec/downloads","issues_url":"https://api.github.com/repos/njoyard/django-perf-rec/issues{/number}","pulls_url":"https://api.github.com/repos/njoyard/django-perf-rec/pulls{/number}","milestones_url":"https://api.github.com/repos/njoyard/django-perf-rec/milestones{/number}","notifications_url":"https://api.github.com/repos/njoyard/django-perf-rec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/njoyard/django-perf-rec/labels{/name}","releases_url":"https://api.github.com/repos/njoyard/django-perf-rec/releases{/id}","deployments_url":"https://api.github.com/repos/njoyard/django-perf-rec/deployments","created_at":"2016-10-25T07:12:43Z","updated_at":"2016-10-25T07:12:44Z","pushed_at":"2016-10-26T09:21:53Z","git_url":"git://github.com/njoyard/django-perf-rec.git","ssh_url":"git@github.com:njoyard/django-perf-rec.git","clone_url":"https://github.com/njoyard/django-perf-rec.git","svn_url":"https://github.com/njoyard/django-perf-rec","homepage":null,"size":48,"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":"YPlan:master","ref":"master","sha":"1019b55db8130128b6894d3315448a0abf30377a","user":{"login":"YPlan","id":2026115,"avatar_url":"https://avatars.githubusercontent.com/u/2026115?v=3","gravatar_id":"","url":"https://api.github.com/users/YPlan","html_url":"https://github.com/YPlan","followers_url":"https://api.github.com/users/YPlan/followers","following_url":"https://api.github.com/users/YPlan/following{/other_user}","gists_url":"https://api.github.com/users/YPlan/gists{/gist_id}","starred_url":"https://api.github.com/users/YPlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YPlan/subscriptions","organizations_url":"https://api.github.com/users/YPlan/orgs","repos_url":"https://api.github.com/users/YPlan/repos","events_url":"https://api.github.com/users/YPlan/events{/privacy}","received_events_url":"https://api.github.com/users/YPlan/received_events","type":"Organization","site_admin":false},"repo":{"id":68371071,"name":"django-perf-rec","full_name":"YPlan/django-perf-rec","owner":{"login":"YPlan","id":2026115,"avatar_url":"https://avatars.githubusercontent.com/u/2026115?v=3","gravatar_id":"","url":"https://api.github.com/users/YPlan","html_url":"https://github.com/YPlan","followers_url":"https://api.github.com/users/YPlan/followers","following_url":"https://api.github.com/users/YPlan/following{/other_user}","gists_url":"https://api.github.com/users/YPlan/gists{/gist_id}","starred_url":"https://api.github.com/users/YPlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YPlan/subscriptions","organizations_url":"https://api.github.com/users/YPlan/orgs","repos_url":"https://api.github.com/users/YPlan/repos","events_url":"https://api.github.com/users/YPlan/events{/privacy}","received_events_url":"https://api.github.com/users/YPlan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/YPlan/django-perf-rec","description":"Keep detailed records of the performance of your Django code.","fork":false,"url":"https://api.github.com/repos/YPlan/django-perf-rec","forks_url":"https://api.github.com/repos/YPlan/django-perf-rec/forks","keys_url":"https://api.github.com/repos/YPlan/django-perf-rec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YPlan/django-perf-rec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YPlan/django-perf-rec/teams","hooks_url":"https://api.github.com/repos/YPlan/django-perf-rec/hooks","issue_events_url":"https://api.github.com/repos/YPlan/django-perf-rec/issues/events{/number}","events_url":"https://api.github.com/repos/YPlan/django-perf-rec/events","assignees_url":"https://api.github.com/repos/YPlan/django-perf-rec/assignees{/user}","branches_url":"https://api.github.com/repos/YPlan/django-perf-rec/branches{/branch}","tags_url":"https://api.github.com/repos/YPlan/django-perf-rec/tags","blobs_url":"https://api.github.com/repos/YPlan/django-perf-rec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YPlan/django-perf-rec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YPlan/django-perf-rec/git/refs{/sha}","trees_url":"https://api.github.com/repos/YPlan/django-perf-rec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YPlan/django-perf-rec/statuses/{sha}","languages_url":"https://api.github.com/repos/YPlan/django-perf-rec/languages","stargazers_url":"https://api.github.com/repos/YPlan/django-perf-rec/stargazers","contributors_url":"https://api.github.com/repos/YPlan/django-perf-rec/contributors","subscribers_url":"https://api.github.com/repos/YPlan/django-perf-rec/subscribers","subscription_url":"https://api.github.com/repos/YPlan/django-perf-rec/subscription","commits_url":"https://api.github.com/repos/YPlan/django-perf-rec/commits{/sha}","git_commits_url":"https://api.github.com/repos/YPlan/django-perf-rec/git/commits{/sha}","comments_url":"https://api.github.com/repos/YPlan/django-perf-rec/comments{/number}","issue_comment_url":"https://api.github.com/repos/YPlan/django-perf-rec/issues/comments{/number}","contents_url":"https://api.github.com/repos/YPlan/django-perf-rec/contents/{+path}","compare_url":"https://api.github.com/repos/YPlan/django-perf-rec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YPlan/django-perf-rec/merges","archive_url":"https://api.github.com/repos/YPlan/django-perf-rec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YPlan/django-perf-rec/downloads","issues_url":"https://api.github.com/repos/YPlan/django-perf-rec/issues{/number}","pulls_url":"https://api.github.com/repos/YPlan/django-perf-rec/pulls{/number}","milestones_url":"https://api.github.com/repos/YPlan/django-perf-rec/milestones{/number}","notifications_url":"https://api.github.com/repos/YPlan/django-perf-rec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YPlan/django-perf-rec/labels{/name}","releases_url":"https://api.github.com/repos/YPlan/django-perf-rec/releases{/id}","deployments_url":"https://api.github.com/repos/YPlan/django-perf-rec/deployments","created_at":"2016-09-16T10:27:25Z","updated_at":"2016-10-24T02:27:33Z","pushed_at":"2016-10-26T12:55:39Z","git_url":"git://github.com/YPlan/django-perf-rec.git","ssh_url":"git@github.com:YPlan/django-perf-rec.git","clone_url":"https://github.com/YPlan/django-perf-rec.git","svn_url":"https://github.com/YPlan/django-perf-rec","homepage":null,"size":55,"stargazers_count":93,"watchers_count":93,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27"},"html":{"href":"https://github.com/YPlan/django-perf-rec/pull/27"},"issue":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/issues/27"},"comments":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/YPlan/django-perf-rec/statuses/262020e03c05760d11257ded021b384b367b1510"}}}}
{"actor":{"display_login":"adamchainz"}}