diff --git a/test/test_model_modules/test_advanced_paddings.py b/test/test_model_modules/test_advanced_paddings.py index be268d401b25681cb9a36498bfc3022a9a55ef1e..7142e1c2a08cd79e8e395032c7331e654b9a9593 100644 --- a/test/test_model_modules/test_advanced_paddings.py +++ b/test/test_model_modules/test_advanced_paddings.py @@ -29,6 +29,22 @@ class TestPadUtils: PadUtils.get_padding_for_same((1, 1), strides=-1) assert 'Strides other than 1 not implemented!' in str(einfo.value) + def test_get_padding_for_same_non_int_kernel(self): + with pytest.raises(ValueError) as einfo: + PadUtils.get_padding_for_same((1., 1)) + assert "The `kernel_size` argument must have a tuple of integers. Got: (1.0, 1) " \ + "of type [<class 'float'>, <class 'int'>]" in str(einfo.value) + + with pytest.raises(ValueError) as einfo: + PadUtils.get_padding_for_same((1, 1.)) + assert "The `kernel_size` argument must have a tuple of integers. Got: (1, 1.0) " \ + "of type [<class 'int'>, <class 'float'>]" in str(einfo.value) + + with pytest.raises(ValueError) as einfo: + PadUtils.get_padding_for_same((1, '1.')) + assert "The `kernel_size` argument must have a tuple of integers. Got: (1, '1.') " \ + "of type [<class 'int'>, <class 'str'>]" in str(einfo.value) + def test_get_padding_for_same_stride_3d(self): kernel = (3, 3, 3) pad = PadUtils.get_padding_for_same(kernel) @@ -50,6 +66,8 @@ class TestPadUtils: PadUtils.get_padding_for_same((2, 4)) assert 'even kernel size not implemented. Got (2, 4)' in str(einfo.value) + ################################################################################## + def test_check_padding_format_negative_pads(self): with pytest.raises(ValueError) as einfo: