{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/37080","labels_url":"https://api.github.com/repos/Homebrew/homebrew/issues/37080/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/37080/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/37080/events","html_url":"https://github.com/Homebrew/homebrew/pull/37080","id":58515591,"number":37080,"title":"test_fixtures: copy in testpath if called during testing","user":{"login":"bfontaine","id":1334295,"avatar_url":"https://avatars.githubusercontent.com/u/1334295?v=3","gravatar_id":"","url":"https://api.github.com/users/bfontaine","html_url":"https://github.com/bfontaine","followers_url":"https://api.github.com/users/bfontaine/followers","following_url":"https://api.github.com/users/bfontaine/following{/other_user}","gists_url":"https://api.github.com/users/bfontaine/gists{/gist_id}","starred_url":"https://api.github.com/users/bfontaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfontaine/subscriptions","organizations_url":"https://api.github.com/users/bfontaine/orgs","repos_url":"https://api.github.com/users/bfontaine/repos","events_url":"https://api.github.com/users/bfontaine/events{/privacy}","received_events_url":"https://api.github.com/users/bfontaine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-22T19:52:29Z","updated_at":"2015-02-23T05:22:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/37080","html_url":"https://github.com/Homebrew/homebrew/pull/37080","diff_url":"https://github.com/Homebrew/homebrew/pull/37080.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/37080.patch"},"body":"I noticed when writing a test for `aacgain` (#37079) that when a test uses a fixture Homebrew doesn’t restore it to its pristine state at the end. This PR fixes that by copying test fixtures in `@testpath` if it’s defined (i.e. we’re running a test)."},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/75491003","html_url":"https://github.com/Homebrew/homebrew/pull/37080#issuecomment-75491003","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/37080","id":75491003,"user":{"login":"jacknagel","id":568243,"avatar_url":"https://avatars.githubusercontent.com/u/568243?v=3","gravatar_id":"","url":"https://api.github.com/users/jacknagel","html_url":"https://github.com/jacknagel","followers_url":"https://api.github.com/users/jacknagel/followers","following_url":"https://api.github.com/users/jacknagel/following{/other_user}","gists_url":"https://api.github.com/users/jacknagel/gists{/gist_id}","starred_url":"https://api.github.com/users/jacknagel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacknagel/subscriptions","organizations_url":"https://api.github.com/users/jacknagel/orgs","repos_url":"https://api.github.com/users/jacknagel/repos","events_url":"https://api.github.com/users/jacknagel/events{/privacy}","received_events_url":"https://api.github.com/users/jacknagel/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T05:22:03Z","updated_at":"2015-02-23T05:22:03Z","body":">so I don't have to double check whether fixtures are altered every time.\r\n\r\nI think anyone writing a test for a formula should understand exactly what that test is doing, including whether or not it modifies files given as input. Since the fixtures are checked into the git repository, changes will be very easy to notice.\r\n\r\nNothing about `test_fixtures(\"name\")` implies that this method copies a file to a different location."}}