Skip to content

Commit

Permalink
Do these inside with blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jzuhone committed Jan 21, 2020
1 parent 3f4fb01 commit 72dd5ac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spectral_cube/tests/test_spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,9 @@ def test_yt_vr(self):
cam.switch_orientation(normal_vector=direction)
cam.set_resolution(32)
im1 = sc.render()
im1_gold = np.load(os.path.join(filepath, "data", "yt_vr1.npz"))
assert_array_equal(im1, im1_gold['arr_0'])
yt_vr1 = os.path.join(filepath, "data", "yt_vr1.npz")
with np.load(yt_vr1) as i1:
assert_array_equal(im1, i1['arr_0'])

# Test movie
im2 = self.ytc1.quick_render_movie('.', size=32, nframes=4,
Expand All @@ -879,8 +880,9 @@ def test_yt_vr(self):
north_vector=(0.0, 1.0, 0.0),
run_ffmpeg=False)
im2 = np.array(im2)
im2_gold = np.load(os.path.join(filepath, "data", "yt_vr2.npz"))
assert_array_equal(im2, im2_gold['arr_0'])
yt_vr2 = os.path.join(filepath, "data", "yt_vr2.npz")
with np.load(yt_vr2) as i2:
assert_array_equal(im2, i2['arr_0'])
self.cube = self.ytc1 = self.ytc2 = self.ytc3 = None

def test_read_write_rountrip(tmpdir, data_adv):
Expand Down

0 comments on commit 72dd5ac

Please sign in to comment.