Commit 12929415 authored by Christoph Groth's avatar Christoph Groth
Browse files

get rid of side effect in test

parent f2ba3eb2
......@@ -151,7 +151,7 @@ def test_map():
with warnings.catch_warnings():
warnings.simplefilter("ignore")
plotter.map(sys.finalized(), xrange(len(sys.sites())),
file=out)
file=out)
nose.tools.assert_raises(ValueError, plotter.map, sys,
xrange(len(sys.sites())), file=out)
......@@ -160,7 +160,6 @@ def test_mask_interpolate():
# A coordinate array with coordinates of two points almost coinciding.
coords = np.array([[0, 0], [1e-7, 1e-7], [1, 1], [1, 0]])
warnings.simplefilter("ignore")
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
plotter.mask_interpolate(coords, np.ones(len(coords)), a=1)
......@@ -168,7 +167,9 @@ def test_mask_interpolate():
assert issubclass(w[-1].category, RuntimeWarning)
assert "coinciding" in str(w[-1].message)
assert_raises(ValueError, plotter.mask_interpolate,
coords, np.ones(len(coords)))
assert_raises(ValueError, plotter.mask_interpolate,
coords, np.ones(2 * len(coords)))
with warnings.catch_warnings():
warnings.simplefilter("ignore")
assert_raises(ValueError, plotter.mask_interpolate,
coords, np.ones(len(coords)))
assert_raises(ValueError, plotter.mask_interpolate,
coords, np.ones(2 * len(coords)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment