{"issue":{"state":"open","created_at":"2011-11-23T04:04:11Z","updated_at":"2011-11-24T03:25:13Z","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"},"comments":7,"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.","assignee":null,"id":2326358,"labels":[],"number":77,"pull_request":{"patch_url":"https://github.com/astropy/astropy/pull/77.patch","html_url":"https://github.com/astropy/astropy/pull/77","diff_url":"https://github.com/astropy/astropy/pull/77.diff"},"title":"Put py.test plugins in root level conftest.py file","closed_at":null,"html_url":"https://github.com/astropy/astropy/issues/77","milestone":null,"url":"https://api.github.com/repos/astropy/astropy/issues/77"},"action":"created","comment":{"created_at":"2011-11-24T03:25:13Z","updated_at":"2011-11-24T03:25:13Z","user":{"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"},"body":"Oh and one other thing I noticed: if I use the py.test script, the remotedata switch is ``--remotedata``, while for ``python setup.py test``, it's ``--remote-data`` (or ``-R``).  I mildly prefer the latter, but either way is fine as long as they are both consistent with each other.","id":2857922,"url":"https://api.github.com/repos/astropy/astropy/issues/comments/2857922"}}