Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions astropy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ class astronomical_constants(base_constants_version):
)


# Create the test() function
from .tests.runner import TestRunner

test = TestRunner.make_test_runner_in(__path__[0])


# if we are *not* in setup mode, import the logger and possibly populate the
# configuration file with the defaults
def _initialize_astropy():
Expand Down
1 change: 0 additions & 1 deletion astropy/tests/tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ def test_toplevel_namespace():
d = dir(astropy)
assert "os" not in d
assert "log" in d
assert "test" in d
assert "sys" not in d
21 changes: 0 additions & 21 deletions astropy/tests/tests/test_run_tests.py

This file was deleted.

4 changes: 2 additions & 2 deletions astropy/utils/tests/test_introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def test_find_mod_objs():

# just check for astropy.test ... other things might be added, so we

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should adjust the comment here to be "just check for astropy.conf"

@pllim pllim Mar 11, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: This test update (with Marten's comment applied) is now #17873 . Thanks again! I added you both as co-authors.

# shouldn't check that it's the only thing
assert "test" in lnms
assert astropy.test in objs
Comment thread
MridulS marked this conversation as resolved.
assert "conf" in lnms
assert astropy.conf in objs

with pytest.warns(AstropyDeprecationWarning, match=deprecation_message):
lnms, fqns, objs = find_mod_objs(__name__, onlylocals=False)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ commands =
!cov-!double: pytest --pyargs astropy {toxinidir}/docs {env:MPLFLAGS} {posargs}
cov-!double: pytest --pyargs astropy {toxinidir}/docs {env:MPLFLAGS} --cov astropy --cov-config={toxinidir}/pyproject.toml --cov-report xml:{toxinidir}/coverage.xml {posargs}

double: python -c 'import sys; from astropy import test; test(); sys.exit(test())'
double: pytest --keep-duplicates --pyargs astropy astropy

pip_pre =
predeps: true
Expand Down