MAINT: Remove astropy.test(), should use pytest directly#16208
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
mhvk
left a comment
There was a problem hiding this comment.
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.
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.
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 ...
There was a problem hiding this comment.
I am making alll the Sphinx doc changes now in #16561. For this bit I am just linking to the testing guidelines page as the one and only-one reference on running tests.
|
|
||
| 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.
Here, the changes are good as is, since we've not installed from source.
There was a problem hiding this comment.
These changes conflict with #16555, so I would suggest reverting all changes to install.rst here.
I can do it later this week, unless someone gets to it before that :) |
|
This is almost certain to conflict with #16561 since that renames This might imply that we don't merge this PR before #16561 so we don't have documentation of something that doesn't work. |
|
|
||
| import astropy | ||
| astropy.test(package='time') | ||
| changes do not break existing code, by running the Astropy tests. |
There was a problem hiding this comment.
I am making alll the Sphinx doc changes now in #16561. For this bit I am just linking to the testing guidelines page as the one and only-one reference on running tests.
| ``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 |
|
|
||
| pytest astropy/wcs/index.rst | ||
|
|
||
| .. _astropy.test(): |
| Pass ``-n auto`` to create the same number of processes as cores | ||
| on your machine. | ||
|
|
||
| Similarly, this feature can be invoked from ``astropy.test``:: |
| running framework. For example doctests and detailed documentation on how to | ||
| write them, see the full :mod:`doctest` documentation. | ||
|
|
||
| .. note:: |
|
|
||
| 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.
These changes conflict with #16555, so I would suggest reverting all changes to install.rst here.
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
e43ba80 to
3c8c238
Compare
|
I've rebased to remove changes to the documentation but haven't changed anything else. How do people feel about deprecation vs removal? |
mhvk
left a comment
There was a problem hiding this comment.
Looks good modulo a small change to the comments.
On the larger question, I think a deprecation error would be good, since we have been asking people to use astropy.test() since forever... I guess it can just be a __getattr__ in the main __init__.py?
| @@ -63,8 +63,8 @@ def test_find_mod_objs(): | |||
|
|
|||
| # just check for astropy.test ... other things might be added, so we | |||
There was a problem hiding this comment.
Should adjust the comment here to be "just check for astropy.conf"
There was a problem hiding this comment.
Update: This test update (with Marten's comment applied) is now #17873 . Thanks again! I added you both as co-authors.
I vote deprecation because we have been asking people to run that for years during RC testing. Release manager for next release also need to remember to modify RC testing instructions. |
|
I think we should deprecate |
|
Thinking about it more, I'm actually OK with just removing it, as long as people trying to use |
|
|
|
It doesn't seem likely to get unstuck in time for the 7.0 feature freeze so I'll remove the milestone. |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
|
Direct removal without deprecation is too controversial, so I am closing this PR but I made a note on #16177 to refer back to this when we get to it in the future. Additionally, I credited Mridul as co-author over at #17732 for the change in |
Blocked by:
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.mainfromastropy.testbut 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 callingpytestdirectly from command line.This is the first step towards removing
TestRunner. There is a lot of code inTestRunnerthat hasn't been touched in 10 years and things will only keep on evolving inpytestto play maintenance catchup 😅