Skip to content

Commit

Permalink
fix: tests not passing
Browse files Browse the repository at this point in the history
  • Loading branch information
paverett committed Mar 5, 2024
1 parent fb732a3 commit 8bcf4a6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion astropy/cosmology/_io/tests/test_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest

from astropy.cosmology._io.latex import _FORMAT_TABLE, write_latex
from astropy.io.registry.base import IORegistryError
from astropy.table import QTable, Table

from .base import ReadWriteDirectTestBase, ReadWriteTestMixinBase
Expand Down Expand Up @@ -57,8 +58,14 @@ def test_write_latex_unsupported_format(self, write, tmp_path):
"""Test for unsupported format"""
fp = tmp_path / "test_write_latex_unsupported_format.tex"
invalid_format = "unsupported"
with pytest.raises(ValueError, match="format must be 'ascii.latex'"):
with pytest.raises((ValueError, IORegistryError)) as exc_info:
write(fp, format=invalid_format)
assert (
exc_info.type is ValueError
and "format must be 'ascii.latex'" in exc_info.value.args[0]
or exc_info.type is IORegistryError
and "No writer defined for format" in exc_info.value.args[0]
)


class TestReadWriteLaTex(ReadWriteDirectTestBase, WriteLATEXTestMixin):
Expand Down

0 comments on commit 8bcf4a6

Please sign in to comment.