New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAINT: Remove astropy.test(), should use pytest directly #16208
base: main
Are you sure you want to change the base?
Conversation
Thank you for your contribution to Astropy! 馃寣 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
0facccd
to
b1451d0
Compare
Thanks! I think this still needs a change log, because we had advertised |
p.s. When requested changes are addressed, this also would need a "Extra CI" label. |
So this would imply that RC testing should be done with |
becae4a
to
1d01377
Compare
Yes, assuming all the paths are fine, this should work just fine. I tried this out with https://github.com/astropy/astropy/wiki/v6.0-RC-Testing and it worked fine with |
1d01377
to
e43ba80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small further comments...
``astropy.test()`` to prevent test runs from taking too long. These tests can | ||
be run by ``astropy.test()`` by adding the ``remote_data='any'`` flag. Turn on | ||
``pytest`` to prevent test runs from taking too long. These tests can | ||
be run by ``pytest`` by adding the ``remote_data='any'`` flag. Turn on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is doubled up. This line and l.308 should be combined into
be included by running ``pytest --remote-data=any``.
|
||
import astropy | ||
astropy.test(package='time') | ||
changes do not break existing code, by running the Astropy tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit out of date in general, since we now suggest to use tox
. I'd either skip the example and go straight to For more details on...
or, perhaps better, rewrite as,
changes do not break existing code, by running the Astropy tests,
e.g., by running::
tox -e test
For more details on running ...
@@ -108,11 +102,16 @@ Testing an Installed ``astropy`` | |||
|
|||
{% if is_development %} | |||
|
|||
The easiest way to test if your installed version of ``astropy`` is running | |||
correctly is to use the :ref:`astropy.test()` function:: | |||
To run tests after installing ``astropy`` we need to install ``pytest`` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, the changes are good as is, since we've not installed from source.
This PR addresses one of the points brought forward in #16177.
This removes
astropy.test()
, this does not deprecate/removeTestRunner
. We can do a deprecation too (astropy.test()
) if folks think this is a tad bit aggressive for downstream code 馃槄 . We can go down the sunpy route too and add a direct call topytest.main
fromastropy.test
but I would argue let's keep the testing separate from final user install. A user shouldn't really ever worry about installing a broken astropy wheel. It should be caught in the CI first! If a user is doing a source build install I think it's fair to assume they are comfortable with callingpytest
directly from command line.This is the first step towards removing
TestRunner
. There is a lot of code inTestRunner
that hasn't been touched in 10 years and things will only keep on evolving inpytest
to play maintenance catchup 馃槄