Skip to content

Commit b09bf10

Browse files
committed
use np.testing
1 parent c234e8c commit b09bf10

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

tests/_basis_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def testExpand(self, basis):
208208
)
209209
assert isinstance(result, Coef)
210210
assert result.dtype == basis.coefficient_dtype
211-
assert result.pixel_size == 1.234
211+
np.testing.assert_array_equal(result.pixel_size, px_sz)
212212

213213
def testInitWithIntSize(self, basis):
214214
# make sure we can instantiate with just an int as a shortcut

tests/test_class_src.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class averages.
209209
assert test_src.symmetry_group == class_sim_fixture.symmetry_group
210210

211211
# Check pixel_size pass-through.
212-
assert test_src.pixel_size == class_sim_fixture.pixel_size
212+
np.testing.assert_array_equal(test_src.pixel_size, class_sim_fixture.pixel_size)
213213

214214

215215
# Test the _HeapItem helper class

tests/test_covar2d_denoiser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test_batched_rotcov2d_MSE(sim, basis):
113113
)
114114

115115
# Test pixel_size pass-through.
116-
assert sim.pixel_size == src.pixel_size
116+
np.testing.assert_array_equal(sim.pixel_size, src.pixel_size)
117117

118118

119119
def test_source_mismatch(sim, basis):

tests/test_simulation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,11 +774,11 @@ def test_pixel_size(caplog):
774774
vol = Volume(data, pixel_size=vol_px_sz)
775775

776776
# Ensure vol pixel size
777-
assert vol.pixel_size == vol_px_sz
777+
np.testing.assert_array_equal(vol.pixel_size, vol_px_sz)
778778

779779
# Generate Simulation and check pixel_size is inhereted from vol
780780
sim = Simulation(vols=vol)
781-
assert sim.pixel_size == vol_px_sz
781+
np.testing.assert_array_equal(sim.pixel_size, vol_px_sz)
782782

783783
# Generate Simulation with provided pixel_size and check
784784
# that vol.pixel_size is overridden.
@@ -796,7 +796,7 @@ def test_pixel_size(caplog):
796796
sim = Simulation(vols=vol, pixel_size=sim_px_sz)
797797

798798
assert msg in caplog.text
799-
assert sim.pixel_size == sim_px_sz
799+
np.testing.assert_array_equal(sim.pixel_size, sim_px_sz)
800800

801801

802802
def test_mismatched_pixel_size():

0 commit comments

Comments
 (0)