{"action":"closed","number":77,"pull_request":{"created_at":"2011-11-23T04:04:11Z","review_comments":1,"state":"closed","updated_at":"2011-11-24T21:50:08Z","patch_url":"https://github.com/astropy/astropy/pull/77.patch","changed_files":3,"_links":{"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/77/comments"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/77/comments"},"html":{"href":"https://github.com/astropy/astropy/pull/77"},"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/77"}},"user":{"gravatar_id":"d16418fe8e1361dc8d8b573a7056f0c5","id":920492,"url":"https://api.github.com/users/jiffyclub","login":"jiffyclub","avatar_url":"https://secure.gravatar.com/avatar/d16418fe8e1361dc8d8b573a7056f0c5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"issue_url":"https://github.com/astropy/astropy/issues/77","comments":11,"body":"One way to have the same py.test behavior for `astropy.test` and `py.test` at the command line is to place our plugins in a `conftest.py` file. py.test searches for a `conftest.py` in its invoking directory or anywhere directly above that directory and uses any hooks it finds in the file. This works both when calling `py.test` directly at the command line or when invoking it using `pytest.main` as the test helper does. This pull request is a working sample of how that would look.\r\n\r\nLooking at the py.test documentation (http://pytest.org/latest/plugins.html#conftest-py-local-per-directory-plugins) it even looks like py.test will discover more than one `conftest.py` file and respect them all, though who knows in what order. This means it would be possible to have a local level `conftest.py` that defines some local test setup hooks and the one at the root level should still be found and used. I haven't tested this, though.","deletions":13,"merged":true,"commits":6,"mergeable":null,"id":521559,"base":{"user":{"gravatar_id":"df333e02889464493106cdf6de217066","id":847984,"url":"https://api.github.com/users/astropy","login":"astropy","avatar_url":"https://secure.gravatar.com/avatar/df333e02889464493106cdf6de217066?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"repo":{"created_at":"2011-07-21T01:33:49Z","pushed_at":"2011-11-24T21:50:09Z","updated_at":"2011-11-24T21:50:09Z","private":false,"clone_url":"https://github.com/astropy/astropy.git","watchers":47,"name":"astropy","master_branch":null,"svn_url":"https://svn.github.com/astropy/astropy","language":"C","forks":17,"owner":{"gravatar_id":"df333e02889464493106cdf6de217066","id":847984,"url":"https://api.github.com/users/astropy","login":"astropy","avatar_url":"https://secure.gravatar.com/avatar/df333e02889464493106cdf6de217066?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"id":2081289,"homepage":"astropy.org","description":"Main AstroPy repository","git_url":"git://github.com/astropy/astropy.git","html_url":"https://github.com/astropy/astropy","size":876,"fork":false,"url":"https://api.github.com/repos/astropy/astropy","open_issues":11,"ssh_url":"git@github.com:astropy/astropy.git"},"sha":"f1737045a8e3cd1699412d69f686c4ab43920ca5","ref":"master","label":"astropy:master"},"merged_by":{"gravatar_id":"b2a66b4a75397bcd42fdd7bb399ee553","id":346587,"url":"https://api.github.com/users/eteq","login":"eteq","avatar_url":"https://secure.gravatar.com/avatar/b2a66b4a75397bcd42fdd7bb399ee553?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":77,"additions":12,"head":{"user":{"gravatar_id":"d16418fe8e1361dc8d8b573a7056f0c5","id":920492,"url":"https://api.github.com/users/jiffyclub","login":"jiffyclub","avatar_url":"https://secure.gravatar.com/avatar/d16418fe8e1361dc8d8b573a7056f0c5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"repo":{"created_at":"2011-09-10T15:24:27Z","pushed_at":"2011-11-24T13:02:19Z","updated_at":"2011-11-24T13:02:19Z","private":false,"clone_url":"https://github.com/jiffyclub/astropy.git","watchers":1,"name":"astropy","master_branch":null,"svn_url":"https://svn.github.com/jiffyclub/astropy","language":"C","forks":0,"owner":{"gravatar_id":"d16418fe8e1361dc8d8b573a7056f0c5","id":920492,"url":"https://api.github.com/users/jiffyclub","login":"jiffyclub","avatar_url":"https://secure.gravatar.com/avatar/d16418fe8e1361dc8d8b573a7056f0c5?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2361256,"homepage":"astropy.org","description":"Main AstroPy repository","git_url":"git://github.com/jiffyclub/astropy.git","html_url":"https://github.com/jiffyclub/astropy","size":148,"fork":true,"url":"https://api.github.com/repos/jiffyclub/astropy","open_issues":0,"ssh_url":"git@github.com:jiffyclub/astropy.git"},"sha":"e758490c0a0e3a08a31ab4ae733486dfc328243f","ref":"pytest-conftest","label":"jiffyclub:pytest-conftest"},"title":"Put py.test plugins in root level conftest.py file","closed_at":"2011-11-24T21:50:08Z","html_url":"https://github.com/astropy/astropy/pull/77","diff_url":"https://github.com/astropy/astropy/pull/77.diff","url":"https://api.github.com/repos/astropy/astropy/pulls/77","merged_at":"2011-11-24T21:50:08Z"}}