{"action":"created","comment":{"url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/comments/40608265","id":40608265,"diff_hunk":"@@ -259,6 +266,52 @@ def __exit__(self, *args, **kwargs):\n         default_context_manager = self.defaults_stack().pop()\n         return default_context_manager.__exit__(*args, **kwargs)\n \n+    @staticmethod\n+    def register_profile(name, settings):\n+        \"\"\"registers a collection of values to be used as a settings profile.\n+        These settings can be loaded in by name. Enable different defaults for\n+        different settings.\n+\n+        - settings is a Settings object\n+\n+        \"\"\"\n+        Settings._profiles[name] = copy.copy(settings)\n+\n+    @staticmethod\n+    def get_profile(name):\n+        \"\"\"Return the profile with the given name.\n+\n+        - name is a string representing the name of the profile\n+         to load\n+        A InvalidArgument exception will be thrown if the\n+         profile does not exist\n+\n+        \"\"\"\n+        try:\n+            return copy.copy(Settings._profiles[name])\n+        except KeyError:\n+            raise InvalidArgument(\n+                \"Profile '{}' has not been registered\".format(","path":"src/hypothesis/settings.py","position":57,"original_position":57,"commit_id":"7f55fbc0536d50d4a59b8eb69d2876d642409837","original_commit_id":"7f55fbc0536d50d4a59b8eb69d2876d642409837","user":{"login":"DRMacIver","id":28623,"avatar_url":"https://avatars.githubusercontent.com/u/28623?v=3","gravatar_id":"","url":"https://api.github.com/users/DRMacIver","html_url":"https://github.com/DRMacIver","followers_url":"https://api.github.com/users/DRMacIver/followers","following_url":"https://api.github.com/users/DRMacIver/following{/other_user}","gists_url":"https://api.github.com/users/DRMacIver/gists{/gist_id}","starred_url":"https://api.github.com/users/DRMacIver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRMacIver/subscriptions","organizations_url":"https://api.github.com/users/DRMacIver/orgs","repos_url":"https://api.github.com/users/DRMacIver/repos","events_url":"https://api.github.com/users/DRMacIver/events{/privacy}","received_events_url":"https://api.github.com/users/DRMacIver/received_events","type":"User","site_admin":false},"body":"Yeah, sorry. :-( I very much regret supporting Python 2.6 but each little change like this doesn't seem *quite* worth dropping it for.","created_at":"2015-09-28T21:31:15Z","updated_at":"2015-09-28T21:31:15Z","html_url":"https://github.com/DRMacIver/hypothesis/pull/154#discussion_r40608265","pull_request_url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/comments/40608265"},"html":{"href":"https://github.com/DRMacIver/hypothesis/pull/154#discussion_r40608265"},"pull_request":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154","id":45500628,"html_url":"https://github.com/DRMacIver/hypothesis/pull/154","diff_url":"https://github.com/DRMacIver/hypothesis/pull/154.diff","patch_url":"https://github.com/DRMacIver/hypothesis/pull/154.patch","issue_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/154","number":154,"state":"open","locked":false,"title":"Create profile loading mechanism","user":{"login":"Bachmann1234","id":1521093,"avatar_url":"https://avatars.githubusercontent.com/u/1521093?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachmann1234","html_url":"https://github.com/Bachmann1234","followers_url":"https://api.github.com/users/Bachmann1234/followers","following_url":"https://api.github.com/users/Bachmann1234/following{/other_user}","gists_url":"https://api.github.com/users/Bachmann1234/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachmann1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachmann1234/subscriptions","organizations_url":"https://api.github.com/users/Bachmann1234/orgs","repos_url":"https://api.github.com/users/Bachmann1234/repos","events_url":"https://api.github.com/users/Bachmann1234/events{/privacy}","received_events_url":"https://api.github.com/users/Bachmann1234/received_events","type":"User","site_admin":false},"body":"Allows users to register settings profiles and load them\r\nin as needed. Allowing for different defaults for different\r\nenvironments\r\n\r\nIs this kind of what you were thinking for the profile setup?\r\n\r\nThis code should enable the following pattern\r\n\r\n```\r\nSettings.register_profile('dev', max_examples=5, max_shrinks=10, max_iterations=100)\r\nSettings.register_profile('ci', max_examples=1000, max_shrinks=1000, max_iterations=2000)\r\n\r\nSettings.load_profile(os.getenv('HYPOTHESIS_PROFILE', 'default'))\r\n```\r\n\r\nIf you think im close ill iterate with you as needed. If we get to something you like let me know and ill write up the docs.","created_at":"2015-09-20T17:47:23Z","updated_at":"2015-09-28T21:31:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ece2b15d770a47515d071668142179e48b24d2e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154/commits","review_comments_url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154/comments","review_comment_url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/154/comments","statuses_url":"https://api.github.com/repos/DRMacIver/hypothesis/statuses/7f55fbc0536d50d4a59b8eb69d2876d642409837","head":{"label":"Bachmann1234:profiles","ref":"profiles","sha":"7f55fbc0536d50d4a59b8eb69d2876d642409837","user":{"login":"Bachmann1234","id":1521093,"avatar_url":"https://avatars.githubusercontent.com/u/1521093?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachmann1234","html_url":"https://github.com/Bachmann1234","followers_url":"https://api.github.com/users/Bachmann1234/followers","following_url":"https://api.github.com/users/Bachmann1234/following{/other_user}","gists_url":"https://api.github.com/users/Bachmann1234/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachmann1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachmann1234/subscriptions","organizations_url":"https://api.github.com/users/Bachmann1234/orgs","repos_url":"https://api.github.com/users/Bachmann1234/repos","events_url":"https://api.github.com/users/Bachmann1234/events{/privacy}","received_events_url":"https://api.github.com/users/Bachmann1234/received_events","type":"User","site_admin":false},"repo":{"id":40411916,"name":"hypothesis","full_name":"Bachmann1234/hypothesis","owner":{"login":"Bachmann1234","id":1521093,"avatar_url":"https://avatars.githubusercontent.com/u/1521093?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachmann1234","html_url":"https://github.com/Bachmann1234","followers_url":"https://api.github.com/users/Bachmann1234/followers","following_url":"https://api.github.com/users/Bachmann1234/following{/other_user}","gists_url":"https://api.github.com/users/Bachmann1234/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachmann1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachmann1234/subscriptions","organizations_url":"https://api.github.com/users/Bachmann1234/orgs","repos_url":"https://api.github.com/users/Bachmann1234/repos","events_url":"https://api.github.com/users/Bachmann1234/events{/privacy}","received_events_url":"https://api.github.com/users/Bachmann1234/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bachmann1234/hypothesis","description":"Hypothesis is an advanced Quickcheck style testing library for Python","fork":true,"url":"https://api.github.com/repos/Bachmann1234/hypothesis","forks_url":"https://api.github.com/repos/Bachmann1234/hypothesis/forks","keys_url":"https://api.github.com/repos/Bachmann1234/hypothesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bachmann1234/hypothesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bachmann1234/hypothesis/teams","hooks_url":"https://api.github.com/repos/Bachmann1234/hypothesis/hooks","issue_events_url":"https://api.github.com/repos/Bachmann1234/hypothesis/issues/events{/number}","events_url":"https://api.github.com/repos/Bachmann1234/hypothesis/events","assignees_url":"https://api.github.com/repos/Bachmann1234/hypothesis/assignees{/user}","branches_url":"https://api.github.com/repos/Bachmann1234/hypothesis/branches{/branch}","tags_url":"https://api.github.com/repos/Bachmann1234/hypothesis/tags","blobs_url":"https://api.github.com/repos/Bachmann1234/hypothesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bachmann1234/hypothesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bachmann1234/hypothesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bachmann1234/hypothesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bachmann1234/hypothesis/statuses/{sha}","languages_url":"https://api.github.com/repos/Bachmann1234/hypothesis/languages","stargazers_url":"https://api.github.com/repos/Bachmann1234/hypothesis/stargazers","contributors_url":"https://api.github.com/repos/Bachmann1234/hypothesis/contributors","subscribers_url":"https://api.github.com/repos/Bachmann1234/hypothesis/subscribers","subscription_url":"https://api.github.com/repos/Bachmann1234/hypothesis/subscription","commits_url":"https://api.github.com/repos/Bachmann1234/hypothesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bachmann1234/hypothesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bachmann1234/hypothesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bachmann1234/hypothesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bachmann1234/hypothesis/contents/{+path}","compare_url":"https://api.github.com/repos/Bachmann1234/hypothesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bachmann1234/hypothesis/merges","archive_url":"https://api.github.com/repos/Bachmann1234/hypothesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bachmann1234/hypothesis/downloads","issues_url":"https://api.github.com/repos/Bachmann1234/hypothesis/issues{/number}","pulls_url":"https://api.github.com/repos/Bachmann1234/hypothesis/pulls{/number}","milestones_url":"https://api.github.com/repos/Bachmann1234/hypothesis/milestones{/number}","notifications_url":"https://api.github.com/repos/Bachmann1234/hypothesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bachmann1234/hypothesis/labels{/name}","releases_url":"https://api.github.com/repos/Bachmann1234/hypothesis/releases{/id}","created_at":"2015-08-08T18:06:33Z","updated_at":"2015-08-08T18:06:34Z","pushed_at":"2015-09-28T04:27:49Z","git_url":"git://github.com/Bachmann1234/hypothesis.git","ssh_url":"git@github.com:Bachmann1234/hypothesis.git","clone_url":"https://github.com/Bachmann1234/hypothesis.git","svn_url":"https://github.com/Bachmann1234/hypothesis","homepage":"","size":3863,"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":"DRMacIver:master","ref":"master","sha":"0139106215e2ab0a4b7f02efe9aaf450396ee71d","user":{"login":"DRMacIver","id":28623,"avatar_url":"https://avatars.githubusercontent.com/u/28623?v=3","gravatar_id":"","url":"https://api.github.com/users/DRMacIver","html_url":"https://github.com/DRMacIver","followers_url":"https://api.github.com/users/DRMacIver/followers","following_url":"https://api.github.com/users/DRMacIver/following{/other_user}","gists_url":"https://api.github.com/users/DRMacIver/gists{/gist_id}","starred_url":"https://api.github.com/users/DRMacIver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRMacIver/subscriptions","organizations_url":"https://api.github.com/users/DRMacIver/orgs","repos_url":"https://api.github.com/users/DRMacIver/repos","events_url":"https://api.github.com/users/DRMacIver/events{/privacy}","received_events_url":"https://api.github.com/users/DRMacIver/received_events","type":"User","site_admin":false},"repo":{"id":8685799,"name":"hypothesis","full_name":"DRMacIver/hypothesis","owner":{"login":"DRMacIver","id":28623,"avatar_url":"https://avatars.githubusercontent.com/u/28623?v=3","gravatar_id":"","url":"https://api.github.com/users/DRMacIver","html_url":"https://github.com/DRMacIver","followers_url":"https://api.github.com/users/DRMacIver/followers","following_url":"https://api.github.com/users/DRMacIver/following{/other_user}","gists_url":"https://api.github.com/users/DRMacIver/gists{/gist_id}","starred_url":"https://api.github.com/users/DRMacIver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRMacIver/subscriptions","organizations_url":"https://api.github.com/users/DRMacIver/orgs","repos_url":"https://api.github.com/users/DRMacIver/repos","events_url":"https://api.github.com/users/DRMacIver/events{/privacy}","received_events_url":"https://api.github.com/users/DRMacIver/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DRMacIver/hypothesis","description":"Hypothesis is an advanced Quickcheck style testing library for Python","fork":false,"url":"https://api.github.com/repos/DRMacIver/hypothesis","forks_url":"https://api.github.com/repos/DRMacIver/hypothesis/forks","keys_url":"https://api.github.com/repos/DRMacIver/hypothesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DRMacIver/hypothesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DRMacIver/hypothesis/teams","hooks_url":"https://api.github.com/repos/DRMacIver/hypothesis/hooks","issue_events_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/events{/number}","events_url":"https://api.github.com/repos/DRMacIver/hypothesis/events","assignees_url":"https://api.github.com/repos/DRMacIver/hypothesis/assignees{/user}","branches_url":"https://api.github.com/repos/DRMacIver/hypothesis/branches{/branch}","tags_url":"https://api.github.com/repos/DRMacIver/hypothesis/tags","blobs_url":"https://api.github.com/repos/DRMacIver/hypothesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DRMacIver/hypothesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DRMacIver/hypothesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/DRMacIver/hypothesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DRMacIver/hypothesis/statuses/{sha}","languages_url":"https://api.github.com/repos/DRMacIver/hypothesis/languages","stargazers_url":"https://api.github.com/repos/DRMacIver/hypothesis/stargazers","contributors_url":"https://api.github.com/repos/DRMacIver/hypothesis/contributors","subscribers_url":"https://api.github.com/repos/DRMacIver/hypothesis/subscribers","subscription_url":"https://api.github.com/repos/DRMacIver/hypothesis/subscription","commits_url":"https://api.github.com/repos/DRMacIver/hypothesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/DRMacIver/hypothesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/DRMacIver/hypothesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/DRMacIver/hypothesis/contents/{+path}","compare_url":"https://api.github.com/repos/DRMacIver/hypothesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DRMacIver/hypothesis/merges","archive_url":"https://api.github.com/repos/DRMacIver/hypothesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DRMacIver/hypothesis/downloads","issues_url":"https://api.github.com/repos/DRMacIver/hypothesis/issues{/number}","pulls_url":"https://api.github.com/repos/DRMacIver/hypothesis/pulls{/number}","milestones_url":"https://api.github.com/repos/DRMacIver/hypothesis/milestones{/number}","notifications_url":"https://api.github.com/repos/DRMacIver/hypothesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DRMacIver/hypothesis/labels{/name}","releases_url":"https://api.github.com/repos/DRMacIver/hypothesis/releases{/id}","created_at":"2013-03-10T13:51:19Z","updated_at":"2015-09-28T20:35:37Z","pushed_at":"2015-09-28T21:29:50Z","git_url":"git://github.com/DRMacIver/hypothesis.git","ssh_url":"git@github.com:DRMacIver/hypothesis.git","clone_url":"https://github.com/DRMacIver/hypothesis.git","svn_url":"https://github.com/DRMacIver/hypothesis","homepage":"","size":10190,"stargazers_count":830,"watchers_count":830,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":34,"forks":74,"open_issues":34,"watchers":830,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154"},"html":{"href":"https://github.com/DRMacIver/hypothesis/pull/154"},"issue":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/issues/154"},"comments":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/DRMacIver/hypothesis/statuses/7f55fbc0536d50d4a59b8eb69d2876d642409837"}}}}