{"action":"created","comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments/36511044","id":36511044,"diff_hunk":"@@ -976,8 +977,22 @@ def _idval(val, argname, idx, idfn):\n                 return s\n         except Exception:\n             pass\n+\n+    try:\n+        import enum\n+    except ImportError:\n+        # Only available in Python 3.4+\n+        enum = None\n+\n     if isinstance(val, (float, int, str, bool, NoneType)):\n         return str(val)\n+    elif isinstance(val, type(re.compile(''))):\n+        # The type of re.compile objects is not exposed in Python.\n+        return val.pattern\n+    elif enum is not None and isinstance(val, enum.Enum):\n+        return str(val)\n+    elif isinstance(val, type) and hasattr(val, '__name__'):\n+        return val.__name__","path":"_pytest/python.py","position":25,"original_position":25,"commit_id":"91a29932a6610cf9097d8bfd11aa6ea5b1247e7e","original_commit_id":"91a29932a6610cf9097d8bfd11aa6ea5b1247e7e","user":{"login":"pfctdayelise","id":360499,"avatar_url":"https://avatars.githubusercontent.com/u/360499?v=3","gravatar_id":"","url":"https://api.github.com/users/pfctdayelise","html_url":"https://github.com/pfctdayelise","followers_url":"https://api.github.com/users/pfctdayelise/followers","following_url":"https://api.github.com/users/pfctdayelise/following{/other_user}","gists_url":"https://api.github.com/users/pfctdayelise/gists{/gist_id}","starred_url":"https://api.github.com/users/pfctdayelise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfctdayelise/subscriptions","organizations_url":"https://api.github.com/users/pfctdayelise/orgs","repos_url":"https://api.github.com/users/pfctdayelise/repos","events_url":"https://api.github.com/users/pfctdayelise/events{/privacy}","received_events_url":"https://api.github.com/users/pfctdayelise/received_events","type":"User","site_admin":false},"body":"maybe add a comment here about what you are expecting this to identify, it's not immediately obvious","created_at":"2015-08-07T11:44:22Z","updated_at":"2015-08-07T11:44:22Z","html_url":"https://github.com/pytest-dev/pytest/pull/923#discussion_r36511044","pull_request_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/923","_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/comments/36511044"},"html":{"href":"https://github.com/pytest-dev/pytest/pull/923#discussion_r36511044"},"pull_request":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/923"}}},"pull_request":{"url":"https://api.github.com/repos/pytest-dev/pytest/pulls/923","id":41861236,"html_url":"https://github.com/pytest-dev/pytest/pull/923","diff_url":"https://github.com/pytest-dev/pytest/pull/923.diff","patch_url":"https://github.com/pytest-dev/pytest/pull/923.patch","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/923","number":923,"state":"open","locked":false,"title":"Generate parametrize IDs for enum/re/class objects.","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"body":"I noticed my tests were generating default IDs for those, so I thought why not make pytest a bit smarter :wink:","created_at":"2015-08-07T05:41:57Z","updated_at":"2015-08-07T11:44:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81362f50d99db72573e09a7b397846df01de6c49","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/923/commits","review_comments_url":"https://api.github.com/repos/pytest-dev/pytest/pulls/923/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/923/comments","statuses_url":"https://api.github.com/repos/pytest-dev/pytest/statuses/91a29932a6610cf9097d8bfd11aa6ea5b1247e7e","head":{"label":"The-Compiler:parametrize-idfunc","ref":"parametrize-idfunc","sha":"91a29932a6610cf9097d8bfd11aa6ea5b1247e7e","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"repo":{"id":37925602,"name":"pytest","full_name":"The-Compiler/pytest","owner":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/The-Compiler/pytest","description":"The pytest testing tool makes it easy to write small tests, yet scales to support complex functional testing","fork":true,"url":"https://api.github.com/repos/The-Compiler/pytest","forks_url":"https://api.github.com/repos/The-Compiler/pytest/forks","keys_url":"https://api.github.com/repos/The-Compiler/pytest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/The-Compiler/pytest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/The-Compiler/pytest/teams","hooks_url":"https://api.github.com/repos/The-Compiler/pytest/hooks","issue_events_url":"https://api.github.com/repos/The-Compiler/pytest/issues/events{/number}","events_url":"https://api.github.com/repos/The-Compiler/pytest/events","assignees_url":"https://api.github.com/repos/The-Compiler/pytest/assignees{/user}","branches_url":"https://api.github.com/repos/The-Compiler/pytest/branches{/branch}","tags_url":"https://api.github.com/repos/The-Compiler/pytest/tags","blobs_url":"https://api.github.com/repos/The-Compiler/pytest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/The-Compiler/pytest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/The-Compiler/pytest/git/refs{/sha}","trees_url":"https://api.github.com/repos/The-Compiler/pytest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/The-Compiler/pytest/statuses/{sha}","languages_url":"https://api.github.com/repos/The-Compiler/pytest/languages","stargazers_url":"https://api.github.com/repos/The-Compiler/pytest/stargazers","contributors_url":"https://api.github.com/repos/The-Compiler/pytest/contributors","subscribers_url":"https://api.github.com/repos/The-Compiler/pytest/subscribers","subscription_url":"https://api.github.com/repos/The-Compiler/pytest/subscription","commits_url":"https://api.github.com/repos/The-Compiler/pytest/commits{/sha}","git_commits_url":"https://api.github.com/repos/The-Compiler/pytest/git/commits{/sha}","comments_url":"https://api.github.com/repos/The-Compiler/pytest/comments{/number}","issue_comment_url":"https://api.github.com/repos/The-Compiler/pytest/issues/comments{/number}","contents_url":"https://api.github.com/repos/The-Compiler/pytest/contents/{+path}","compare_url":"https://api.github.com/repos/The-Compiler/pytest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/The-Compiler/pytest/merges","archive_url":"https://api.github.com/repos/The-Compiler/pytest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/The-Compiler/pytest/downloads","issues_url":"https://api.github.com/repos/The-Compiler/pytest/issues{/number}","pulls_url":"https://api.github.com/repos/The-Compiler/pytest/pulls{/number}","milestones_url":"https://api.github.com/repos/The-Compiler/pytest/milestones{/number}","notifications_url":"https://api.github.com/repos/The-Compiler/pytest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/The-Compiler/pytest/labels{/name}","releases_url":"https://api.github.com/repos/The-Compiler/pytest/releases{/id}","created_at":"2015-06-23T14:56:54Z","updated_at":"2015-06-23T14:56:54Z","pushed_at":"2015-08-07T05:58:17Z","git_url":"git://github.com/The-Compiler/pytest.git","ssh_url":"git@github.com:The-Compiler/pytest.git","clone_url":"https://github.com/The-Compiler/pytest.git","svn_url":"https://github.com/The-Compiler/pytest","homepage":"http://pytest.org/","size":6400,"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:master","ref":"master","sha":"4f83586f55d91824467ff9b61118328b8fb4dd7c","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 testing tool 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}","created_at":"2015-06-15T20:28:27Z","updated_at":"2015-08-05T18:48:30Z","pushed_at":"2015-08-07T11:32:04Z","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":7404,"stargazers_count":246,"watchers_count":246,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":260,"forks":49,"open_issues":260,"watchers":246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/923"},"html":{"href":"https://github.com/pytest-dev/pytest/pull/923"},"issue":{"href":"https://api.github.com/repos/pytest-dev/pytest/issues/923"},"comments":{"href":"https://api.github.com/repos/pytest-dev/pytest/issues/923/comments"},"review_comments":{"href":"https://api.github.com/repos/pytest-dev/pytest/pulls/923/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/923/commits"},"statuses":{"href":"https://api.github.com/repos/pytest-dev/pytest/statuses/91a29932a6610cf9097d8bfd11aa6ea5b1247e7e"}}}}