{"action":"created","issue":{"url":"https://api.github.com/repos/stretchr/testify/issues/115","labels_url":"https://api.github.com/repos/stretchr/testify/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/stretchr/testify/issues/115/comments","events_url":"https://api.github.com/repos/stretchr/testify/issues/115/events","html_url":"https://github.com/stretchr/testify/pull/115","id":53973301,"number":115,"title":"Allow custom test name formats","user":{"login":"nelsam","id":1019908,"avatar_url":"https://avatars.githubusercontent.com/u/1019908?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsam","html_url":"https://github.com/nelsam","followers_url":"https://api.github.com/users/nelsam/followers","following_url":"https://api.github.com/users/nelsam/following{/other_user}","gists_url":"https://api.github.com/users/nelsam/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsam/subscriptions","organizations_url":"https://api.github.com/users/nelsam/orgs","repos_url":"https://api.github.com/users/nelsam/repos","events_url":"https://api.github.com/users/nelsam/events{/privacy}","received_events_url":"https://api.github.com/users/nelsam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-10T22:12:44Z","updated_at":"2015-11-01T21:40:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stretchr/testify/pulls/115","html_url":"https://github.com/stretchr/testify/pull/115","diff_url":"https://github.com/stretchr/testify/pull/115.diff","patch_url":"https://github.com/stretchr/testify/pull/115.patch"},"body":"When using suites, test names were just the raw suite method name, but that's often not\r\ndetailed enough to know what the problem is.  This commit adds the ability to pass a custom\r\nname format using certain formatting marks (sort of similar to templating strings) to\r\ninclude the name of the function that called Run or NamedRun, the name of the suite's type,\r\nand/or the name of the method.\r\n\r\nCustom test names can be used one of two ways:\r\n\r\n1. When running tests, use `go test -nameformat someFormat` to use \"someFormat\" as the global format for test names.\r\n2. In your test function, call `suite.NamedRun(\"someFormat\", t, suite)` to use \"someFormat\" as the format for test names for suite's testing methods.  This is overridden by the `-nameformat` flag.\r\n\r\nValid format strings (so far) are:\r\n\r\n* `\"{function}\"`: The name of the function that called `suite.Run` or `suite.NamedRun`.\r\n* `\"{suite}\"`: The name of the suite's type.  If the suite is a pointer, the indirect's type name will be used instead.\r\n* `\"{method}\"`: The name of the test method."},"comment":{"url":"https://api.github.com/repos/stretchr/testify/issues/comments/152867710","html_url":"https://github.com/stretchr/testify/pull/115#issuecomment-152867710","issue_url":"https://api.github.com/repos/stretchr/testify/issues/115","id":152867710,"user":{"login":"ernesto-jimenez","id":1005,"avatar_url":"https://avatars.githubusercontent.com/u/1005?v=3","gravatar_id":"","url":"https://api.github.com/users/ernesto-jimenez","html_url":"https://github.com/ernesto-jimenez","followers_url":"https://api.github.com/users/ernesto-jimenez/followers","following_url":"https://api.github.com/users/ernesto-jimenez/following{/other_user}","gists_url":"https://api.github.com/users/ernesto-jimenez/gists{/gist_id}","starred_url":"https://api.github.com/users/ernesto-jimenez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ernesto-jimenez/subscriptions","organizations_url":"https://api.github.com/users/ernesto-jimenez/orgs","repos_url":"https://api.github.com/users/ernesto-jimenez/repos","events_url":"https://api.github.com/users/ernesto-jimenez/events{/privacy}","received_events_url":"https://api.github.com/users/ernesto-jimenez/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T21:40:34Z","updated_at":"2015-11-01T21:40:34Z","body":"@nelsam I'm going through open PRs and go to the ones before I was contributing to the project :)\r\n\r\nI'm going to add a couple of comments I've got in the source code."}}