diff options
Diffstat (limited to 'numpy/lib/tests/test_arraypad.py')
-rw-r--r-- | numpy/lib/tests/test_arraypad.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py index 6ae3ef5c0..cd75b4ac4 100644 --- a/numpy/lib/tests/test_arraypad.py +++ b/numpy/lib/tests/test_arraypad.py @@ -29,7 +29,7 @@ _all_modes = { } -class TestAsPairs(object): +class TestAsPairs: def test_single_value(self): """Test casting for a single value.""" expected = np.array([[3, 3]] * 10) @@ -112,7 +112,7 @@ class TestAsPairs(object): _as_pairs(np.ones((2, 3)), 3) -class TestConditionalShortcuts(object): +class TestConditionalShortcuts: @pytest.mark.parametrize("mode", _all_modes.keys()) def test_zero_padding_shortcuts(self, mode): test = np.arange(120).reshape(4, 5, 6) @@ -134,7 +134,7 @@ class TestConditionalShortcuts(object): np.pad(test, pad_amt, mode=mode, stat_length=30)) -class TestStatistic(object): +class TestStatistic: def test_check_mean_stat_length(self): a = np.arange(100).astype('f') a = np.pad(a, ((25, 20), ), 'mean', stat_length=((2, 3), )) @@ -496,7 +496,7 @@ class TestStatistic(object): np.pad([1., 2.], 1, mode, stat_length=(1, 0)) -class TestConstant(object): +class TestConstant: def test_check_constant(self): a = np.arange(100) a = np.pad(a, (25, 20), 'constant', constant_values=(10, 20)) @@ -675,7 +675,7 @@ class TestConstant(object): assert result.shape == (3, 4, 4) -class TestLinearRamp(object): +class TestLinearRamp: def test_check_simple(self): a = np.arange(100).astype('f') a = np.pad(a, (25, 20), 'linear_ramp', end_values=(4, 5)) @@ -760,7 +760,7 @@ class TestLinearRamp(object): assert_equal(result, expected) -class TestReflect(object): +class TestReflect: def test_check_simple(self): a = np.arange(100) a = np.pad(a, (25, 20), 'reflect') @@ -870,7 +870,7 @@ class TestReflect(object): assert_array_equal(a, b) -class TestEmptyArray(object): +class TestEmptyArray: """Check how padding behaves on arrays with an empty dimension.""" @pytest.mark.parametrize( @@ -894,7 +894,7 @@ class TestEmptyArray(object): assert result.shape == (8, 0, 4) -class TestSymmetric(object): +class TestSymmetric: def test_check_simple(self): a = np.arange(100) a = np.pad(a, (25, 20), 'symmetric') @@ -1028,7 +1028,7 @@ class TestSymmetric(object): assert_array_equal(a, b) -class TestWrap(object): +class TestWrap: def test_check_simple(self): a = np.arange(100) a = np.pad(a, (25, 20), 'wrap') @@ -1142,7 +1142,7 @@ class TestWrap(object): assert_array_equal(np.r_[a, a, a, a][:-3], b) -class TestEdge(object): +class TestEdge: def test_check_simple(self): a = np.arange(12) a = np.reshape(a, (4, 3)) @@ -1181,7 +1181,7 @@ class TestEdge(object): assert_array_equal(padded, expected) -class TestEmpty(object): +class TestEmpty: def test_simple(self): arr = np.arange(24).reshape(4, 6) result = np.pad(arr, [(2, 3), (3, 1)], mode="empty") @@ -1229,7 +1229,7 @@ def test_object_input(mode): assert_array_equal(np.pad(a, pad_amt, mode=mode), b) -class TestPadWidth(object): +class TestPadWidth: @pytest.mark.parametrize("pad_width", [ (4, 5, 6, 7), ((1,), (2,), (3,)), |