Skip to content

Commit b54cc0d

Browse files
authored
Merge pull request astropy#13074 from nstarman/cosmo-io-cosmology
Import cosmology io
2 parents 43ee580 + 67f57fc commit b54cc0d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

astropy/cosmology/io/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"""
77

88
# Import to register with the I/O machinery
9-
from . import ecsv, mapping, model, row, table, yaml # noqa: F403
9+
from . import cosmology, ecsv, mapping, model, row, table, yaml # noqa: F403

astropy/cosmology/io/tests/test_.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
3+
"""Test that all expected methods are present, before I/O tests import.
4+
5+
This file is weirdly named so that it's the first test of I/O.
6+
"""
7+
8+
from astropy.cosmology.connect import convert_registry, readwrite_registry
9+
10+
11+
def test_expected_readwrite_io():
12+
"""Test that ONLY the expected I/O is registered."""
13+
14+
got = {k for k, _ in readwrite_registry._readers.keys()}
15+
expected = {"ascii.ecsv"}
16+
17+
assert got == expected
18+
19+
20+
def test_expected_convert_io():
21+
"""Test that ONLY the expected I/O is registered."""
22+
23+
got = {k for k, _ in convert_registry._readers.keys()}
24+
expected = {"astropy.cosmology", "mapping", "astropy.model", "astropy.row",
25+
"astropy.table", "yaml"}
26+
27+
assert got == expected

0 commit comments

Comments
 (0)