This may be more of an upstream issue, but I can't use pytest-cov with an internal test suite we have running at MAST. Using coverage directly works, but I want to use pytest-xdist, which requires pytest-cov and doesn't work correctly with coverage.
test_minimal.py
I run the above test file with this command:
pytest --cov=astroquery.mast tests/test_minimal.py
The versions I have in my environment are:
- Python = 3.12
- pytest = 9.1.0
- pytest-cov = 7.1.0
- coverage = 7.14.1
- astroquery = 0.4.11 (or installed from GH)
- astropy = 7.2.0
- numpy = 1.26.4
The traceback I get is:
tests/test_minimal.py:1: in <module>
from astroquery.mast import Observations
/opt/miniconda3/envs/amt/lib/python3.12/site-packages/astroquery/__init__.py:18: in <module>
from .logger import _init_log
/opt/miniconda3/envs/amt/lib/python3.12/site-packages/astroquery/logger.py:3: in <module>
from astropy.logger import AstropyLogger
/opt/miniconda3/envs/amt/lib/python3.12/site-packages/astropy/__init__.py:197: in <module>
log = _init_log()
^^^^^^^^^^^
/opt/miniconda3/envs/amt/lib/python3.12/site-packages/astropy/logger.py:122: in _init_log
log._set_defaults()
/opt/miniconda3/envs/amt/lib/python3.12/site-packages/astropy/logger.py:498: in _set_defaults
self.disable_warnings_logging()
/opt/miniconda3/envs/amt/lib/python3.12/site-packages/astropy/logger.py:278: in disable_warnings_logging
raise LoggingError(
E astropy.logger.LoggingError: Cannot disable warnings logging: warnings.showwarning was not set by this logger, or has been overridden
This may be more of an upstream issue, but I can't use
pytest-covwith an internal test suite we have running at MAST. Usingcoveragedirectly works, but I want to usepytest-xdist, which requirespytest-covand doesn't work correctly withcoverage.test_minimal.py
I run the above test file with this command:
pytest --cov=astroquery.mast tests/test_minimal.pyThe versions I have in my environment are:
The traceback I get is: