MCPcopy Create free account
hub / github.com/numpy/numpy / test_npzfile_dict

Function test_npzfile_dict

numpy/lib/tests/test_io.py:2722–2746  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2720
2721
2722def test_npzfile_dict():
2723 s = BytesIO()
2724 x = np.zeros((3, 3))
2725 y = np.zeros((3, 3))
2726
2727 np.savez(s, x=x, y=y)
2728 s.seek(0)
2729
2730 z = np.load(s)
2731
2732 assert_('x' in z)
2733 assert_('y' in z)
2734 assert_('x' in z.keys())
2735 assert_('y' in z.keys())
2736
2737 for f, a in z.items():
2738 assert_(f in ['x', 'y'])
2739 assert_equal(a.shape, (3, 3))
2740
2741 assert_(len(z.items()) == 2)
2742
2743 for f in z:
2744 assert_(f in ['x', 'y'])
2745
2746 assert_('x' in z.keys())
2747
2748
2749@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
assert_equalFunction · 0.90
seekMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected