diff --git a/tests/st/ops/gpu/test_randperm.py b/tests/st/ops/gpu/test_randperm.py index 7cea96fd7cb..8e16bc3a756 100644 --- a/tests/st/ops/gpu/test_randperm.py +++ b/tests/st/ops/gpu/test_randperm.py @@ -103,6 +103,6 @@ def test_randperm_uint64(): @pytest.mark.platform_x86_gpu_training @pytest.mark.env_onecard def test_randperm_n_too_large(): - with pytest.raises(RuntimeError) as info: + with pytest.raises(ValueError) as info: randperm(1, 0, mindspore.int32, 2) - assert "n (2) cannot exceed max_length_ (1)" in str(info.value) + assert "For 'Randperm', input 'n' (2) cannot exceed 'max_length' (1)." in str(info.value)