Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ xmatch
Infrastructure, Utility and Other Changes and Additions
-------------------------------------------------------

- Removed usage of the astropy TestRunner, therefore the unadvertised
``astroquery.test()`` functionality. [#3215]


0.4.9 (2025-01-24)
==================
Expand Down
4 changes: 2 additions & 2 deletions astroquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import __version__, __githash__, test
from ._astropy_init import __version__, __githash__
# ----------------------------------------------------------------------------

import os
Expand All @@ -18,7 +18,7 @@
from .logger import _init_log
from astropy import config as _config

__all__ = ["__version__", "__githash__", "__citation__", "__bibtex__", "test", "log"]
__all__ = ["__version__", "__githash__", "__citation__", "__bibtex__", "log"]


# Set the bibtex entry to the article referenced in CITATION.
Expand Down
10 changes: 0 additions & 10 deletions astroquery/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,3 @@
from .version import githash as __githash__
except ImportError:
__githash__ = ''


if not _ASTROPY_SETUP_: # noqa
import os

# Create the test function for self test
from astropy.tests.runner import TestRunner
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
test.__test__ = False
__all__ += ['test']
78 changes: 0 additions & 78 deletions astroquery/conftest.py

This file was deleted.

32 changes: 30 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import numpy as np
from astropy.utils import minversion
import os
from pathlib import Path

from astropy.utils import minversion
import numpy as np
import pytest
from pytest_astropy_header.display import (PYTEST_HEADER_MODULES,
TESTED_VERSIONS)

Expand All @@ -22,6 +25,10 @@ def pytest_configure(config):
PYTEST_HEADER_MODULES['astropy-healpix'] = 'astropy_healpix'
PYTEST_HEADER_MODULES['vamdclib'] = 'vamdclib'

del PYTEST_HEADER_MODULES['h5py']
del PYTEST_HEADER_MODULES['Scipy']
del PYTEST_HEADER_MODULES['Pandas']

# keyring doesn't provide __version__ any more
# PYTEST_HEADER_MODULES['keyring'] = 'keyring'

Expand All @@ -32,3 +39,24 @@ def pytest_configure(config):

TESTED_VERSIONS['astroquery'] = version.version
TESTED_VERSIONS['astropy_helpers'] = version.astropy_helpers_version


def pytest_addoption(parser):
parser.addoption(
'--alma-site',
action='store',
default='almascience.eso.org',
help='ALMA site (almascience.nrao.edu, almascience.eso.org or '
'almascience.nao.ac.jp for example)'
)


@pytest.fixture(scope='function')
def tmp_cwd(tmp_path):
"""Perform test in a pristine temporary working directory."""
old_dir = Path.cwd()
os.chdir(tmp_path)
try:
yield tmp_path
finally:
os.chdir(old_dir)
Loading