Skip to content

Commit d71a2b1

Browse files
Initial fixes for errors in issue astropy#12283.
1 parent 39cb148 commit d71a2b1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎astropy/modeling/bounding_box.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def validate(cls, model, bounding_box,
341341

342342
return new
343343

344-
def copy(self) -> 'BoundingBox':
344+
def copy(self):
345345
return BoundingBox(self._intervals.copy(), self._model, self._order)
346346

347347
def fix_inputs(self, model, fixed_inputs: list):

‎astropy/modeling/tests/test_bounding_box.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ def test__validate_bounds(self):
102102
assert (interval.upper == np.array([2.5, 3.5])).all()
103103

104104
# Fails
105-
with pytest.raises(RuntimeWarning) as err:
105+
with pytest.warns(RuntimeWarning) as err:
106106
Interval._validate_bounds(2, 1)
107-
assert str(err.value) == \
107+
assert str(err[0].message.args[0]) == \
108108
"Invalid interval: upper bound 1 is strictly less than lower bound 2."
109-
with pytest.raises(RuntimeWarning) as err:
109+
with pytest.warns(RuntimeWarning) as err:
110110
Interval._validate_bounds(2*u.m, 1*u.m)
111-
assert str(err.value) == \
111+
assert str(err[0].message.args[0]) == \
112112
"Invalid interval: upper bound 1.0 m is strictly less than lower bound 2.0 m."
113113

114114
def test_validate(self):
@@ -141,7 +141,7 @@ def test_validate(self):
141141
Interval.validate((1, 2, 3))
142142

143143
# Fail bounds
144-
with pytest.raises(RuntimeWarning):
144+
with pytest.warns(RuntimeWarning):
145145
Interval.validate((2, 1))
146146

147147
def test_outside(self):

0 commit comments

Comments
 (0)