From 3dc26e2a9d7e93680b7bcdfb739b1f846793d632 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Thu, 3 Sep 2020 09:23:28 -0400 Subject: [PATCH] Don't cover error in else statement that probably cannot be reached any longer --- galpy/potential/verticalPotential.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/galpy/potential/verticalPotential.py b/galpy/potential/verticalPotential.py index 8e291aed4..4310a8086 100644 --- a/galpy/potential/verticalPotential.py +++ b/galpy/potential/verticalPotential.py @@ -130,7 +130,9 @@ def RZToverticalPotential(RZPot,R): return RZPot elif isinstance(RZPot,planarPotential): raise PotentialError("Input to 'RZToverticalPotential' cannot be a planarPotential") - else: + else: # pragma: no cover + # All other cases should have been caught by the + # conversion.get_physical test above raise PotentialError("Input to 'RZToverticalPotential' is neither an RZPotential-instance or a list of such instances") def toVerticalPotential(Pot,R,phi=None,t0=0.): @@ -181,7 +183,9 @@ def toVerticalPotential(Pot,R,phi=None,t0=0.): out.append(verticalPotential(pot,R,phi=phi,t0=t0)) elif isinstance(pot,planarPotential): raise PotentialError("Input to 'toVerticalPotential' cannot be a planarPotential") - else: + else: # pragma: no cover + # All other cases should have been caught by the + # conversion.get_physical test above raise PotentialError("Input to 'toVerticalPotential' is neither an RZPotential-instance or a list of such instances") return out elif isinstance(Pot,Potential): @@ -190,6 +194,8 @@ def toVerticalPotential(Pot,R,phi=None,t0=0.): return Pot elif isinstance(Pot,planarPotential): raise PotentialError("Input to 'toVerticalPotential' cannot be a planarPotential") - else: + else: # pragma: no cover + # All other cases should have been caught by the + # conversion.get_physical test above raise PotentialError("Input to 'toVerticalPotential' is neither an Potential-instance or a list of such instances")