Skip to content

Commit

Permalink
Merge pull request #132 from avalentino/feature/drop-test-helpers
Browse files Browse the repository at this point in the history
Drop the no longer needed tests/helpers.py
  • Loading branch information
mhvk authored Oct 28, 2023
2 parents 6a819bd + 411e9b2 commit f94cf65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 129 deletions.
122 changes: 0 additions & 122 deletions erfa/tests/helper.py

This file was deleted.

9 changes: 2 additions & 7 deletions erfa/tests/test_erfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_allclose

import erfa
from erfa.tests.helper import catch_warnings

try:
from astropy.time import Time
Expand Down Expand Up @@ -172,18 +171,14 @@ def test_errwarn_reporting():
erfa.dat(1990, 1, 1, 0.5)

# check warning is raised for a scalar
with catch_warnings() as w:
with pytest.warns(erfa.ErfaWarning, match=r'1 of "dubious year \(Note 1\)"') as w:
erfa.dat(100, 1, 1, 0.5)
assert len(w) == 1
assert w[0].category == erfa.ErfaWarning
assert '1 of "dubious year (Note 1)"' in str(w[0].message)

# and that the count is right for a vector.
with catch_warnings() as w:
with pytest.warns(erfa.ErfaWarning, match=r'2 of "dubious year \(Note 1\)"') as w:
erfa.dat([100, 200, 1990], 1, 1, 0.5)
assert len(w) == 1
assert w[0].category == erfa.ErfaWarning
assert '2 of "dubious year (Note 1)"' in str(w[0].message)

try:
erfa.dat(1990, [1, 34, 2], [1, 1, 43], 0.5)
Expand Down

0 comments on commit f94cf65

Please sign in to comment.