Skip to content

Commit

Permalink
add tests for deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Feb 26, 2025
1 parent ca3b939 commit 33067b1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,18 @@ def find_gen_by_id(object_id):
# many models which would indicate they are difficult to garbage
# collect.
assert len(mids) < 2


def test_read_deprecation(tmp_path):
fn = tmp_path / "test.fits"
m = DataModel()
m.save(fn)
with pytest.warns(DeprecationWarning, match="read is deprecated"):
m.read(fn)


def test_write_deprecation(tmp_path):
fn = tmp_path / "test.fits"
m = DataModel()
with pytest.warns(DeprecationWarning, match="write is deprecated"):
m.write(fn)

0 comments on commit 33067b1

Please sign in to comment.