Skip to content

Commit

Permalink
Merge pull request #80 from WilliamJamieson/feature/fix_helpers
Browse files Browse the repository at this point in the history
Fix pytest dependency for helpers
  • Loading branch information
WilliamJamieson committed May 31, 2022
2 parents 5029c93 + 0fae8e1 commit 816dc57
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Python 3.8 Tests
python-version: "3.8"
os: ubuntu-latest
toxenv: py38-test
toxenv: py38-test-cov

- name: Mac OS Latest
python-version: "3.9"
Expand Down
41 changes: 0 additions & 41 deletions asdf_astropy/converters/coordinates/tests/helpers.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
from astropy import units as u
from astropy.coordinates import ICRS, Galactic, SpectralCoord
from astropy.coordinates.spectral_coordinate import NoVelocityWarning
from astropy.tests.helper import assert_quantity_allclose

from asdf_astropy.testing.helpers import assert_frame_equal
from asdf_astropy.testing.helpers import assert_spectral_coord_equal


def create_spectral_coords():
Expand Down Expand Up @@ -46,7 +45,4 @@ def test_serialization(coord, tmp_path):
af.write_to(file_path)

with asdf.open(file_path) as af:
assert type(af["coord"]) is type(coord)
assert_quantity_allclose(af["coord"].quantity, coord.quantity)
assert_frame_equal(af["coord"].observer, coord.observer)
assert_frame_equal(af["coord"].target, coord.target)
assert_spectral_coord_equal(af["coord"], coord)
9 changes: 6 additions & 3 deletions asdf_astropy/testing/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from astropy import units
from astropy.coordinates import EarthLocation
from astropy.tests.helper import assert_quantity_allclose
from numpy.testing import assert_array_equal


Expand All @@ -11,6 +8,8 @@ def assert_earth_location_equal(a, b):


def assert_representation_equal(a, b):
from astropy import units

__tracebackhide__ = True

assert type(a) is type(b)
Expand Down Expand Up @@ -41,6 +40,8 @@ def assert_frame_equal(a, b):


def assert_spectral_coord_equal(a, b):
from astropy.tests.helper import assert_quantity_allclose

__tracebackhide__ = True

assert type(a) is type(b)
Expand All @@ -50,6 +51,8 @@ def assert_spectral_coord_equal(a, b):


def assert_time_equal(a, b):
from astropy.coordinates import EarthLocation

assert a.format == b.format
assert a.scale == b.scale

Expand Down

0 comments on commit 816dc57

Please sign in to comment.