Skip to content

Commit e4484bb

Browse files
committed
Precommit fix
1 parent f976325 commit e4484bb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ndcube/tests/test_ndcube.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def test_squeeze(ndcube_4d_ln_l_t_lt):
8989

9090
def test_squeeze_error(ndcube_4d_ln_l_t_lt):
9191
same = ndcube_4d_ln_l_t_lt.squeeze()[0:1,:,:,:]
92-
with pytest.raises(ValueError, match="Cannot select any axis to squeeze out, as none of them has size equal to one."):
92+
with pytest.raises(ValueError, match=r"Cannot select any axis to squeeze out, as none of them has size equal to one."):
9393
same.squeeze([0,1])
94-
with pytest.raises(ValueError, match="All axes are of length 1, therefore we will not squeeze NDCube to become a scalar. Use `axis=` keyword to specify a subset of axes to squeeze."):
94+
with pytest.raises(ValueError, match=r"All axes are of length 1, therefore we will not squeeze NDCube to become a scalar. Use `axis=` keyword to specify a subset of axes to squeeze."):
9595
same[0:1,0:1,0:1,0:1].squeeze()
9696

9797

@@ -159,7 +159,7 @@ def test_set_data_mask(ndcube_4d_mask):
159159
new_mask = np.zeros_like(cube.mask)
160160
masked_array = np.ma.MaskedArray(new_data, new_mask)
161161

162-
with pytest.raises(TypeError, match="Can not set the .data .* with a numpy masked array"):
162+
with pytest.raises(TypeError, match=r"Can not set the .data .* with a numpy masked array"):
163163
cube.data = masked_array
164164

165165

@@ -231,7 +231,7 @@ def test_fill_masked_fill_in_place_false(ndc, fill_value, uncertainty_fill_value
231231
)
232232
def test_fill_masked_ndc_uncertainty_none(ndc, fill_value, uncertainty_fill_value, unmask):
233233
assert ndc.uncertainty is None
234-
with pytest.raises(TypeError,match="Cannot fill uncertainty as uncertainty is None."):
234+
with pytest.raises(TypeError, match=r"Cannot fill uncertainty as uncertainty is None."):
235235
ndc.fill_masked(
236236
fill_value,
237237
unmask=unmask,

ndcube/tests/test_ndcube_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_cube_arithmetic_add(ndcube_2d_ln_lt_units, value): # this test methods
4545
indirect=("ndc",))
4646
def test_arithmetic_add_one_unit(ndc, value):
4747
assert isinstance(ndc, NDCube)
48-
with pytest.raises(TypeError, match="Adding objects requires that both have a unit or neither has a unit."):
48+
with pytest.raises(TypeError, match=r"Adding objects requires that both have a unit or neither has a unit."):
4949
ndc + value
5050

5151

0 commit comments

Comments
 (0)