Skip to content

Commit

Permalink
update error type returned during test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Grimmett committed Nov 15, 2024
1 parent 8506427 commit f0b503c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5299,6 +5299,7 @@ def test_orbitfit():

def test_orbitfit_potinput():
from galpy.orbit import Orbit
from galpy.potential import PotentialError

lp = potential.LogarithmicHaloPotential(normalize=1.0, q=0.9)
o = Orbit([0.8, 0.3, 1.3, 0.4, 0.2, 2.0])
Expand All @@ -5310,10 +5311,10 @@ def test_orbitfit_potinput():
of = o()
try:
Orbit.from_fit(o.vxvv[0], vxvv, pot=None, tintJ=1.5)
except AttributeError:
except PotentialError:
pass
else:
raise AssertionError("Orbit fit w/o potential does not raise AttributeError")
raise AssertionError("Orbit fit w/o potential does not raise PotentialError")
# Now give a potential to of
of = Orbit.from_fit(o.vxvv[0], vxvv, pot=lp, tintJ=1.5)
assert numpy.all(
Expand Down

0 comments on commit f0b503c

Please sign in to comment.