()
| 2720 | |
| 2721 | |
| 2722 | def 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") |
nothing calls this directly
no test coverage detected