diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py index da1634eecebc..d0ffe5f70dbd 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py +++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py @@ -40,12 +40,6 @@ def setUpModels(self): self.pet.category = self.category self.pet.tags = [self.tag] - def test_set_param_validation(self): - try: - self.pet_api.find_pets_by_tags(["a", "a"]) - except ValidationError as e: - self.assertTrue("the list has duplicated items" in str(e)) - def test_required_param_validation(self): try: self.pet_api.get_pet_by_id() # type: ignore diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_api_validation.py index d4c89e23946d..81ffe035470c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_api_validation.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_api_validation.py @@ -47,10 +47,10 @@ def setUpModels(self): self.pet.tags = [self.tag] def test_set_param_validation(self): - try: + with self.assertRaisesRegex( + ValidationError, "the list has duplicated items" + ): self.pet_api.find_pets_by_tags(["a", "a"]) - except ValidationError as e: - self.assertTrue("the list has duplicated items" in str(e)) def test_required_param_validation(self): try: diff --git a/samples/openapi3/client/petstore/python/tests/test_api_validation.py b/samples/openapi3/client/petstore/python/tests/test_api_validation.py index da1634eecebc..d0ffe5f70dbd 100644 --- a/samples/openapi3/client/petstore/python/tests/test_api_validation.py +++ b/samples/openapi3/client/petstore/python/tests/test_api_validation.py @@ -40,12 +40,6 @@ def setUpModels(self): self.pet.category = self.category self.pet.tags = [self.tag] - def test_set_param_validation(self): - try: - self.pet_api.find_pets_by_tags(["a", "a"]) - except ValidationError as e: - self.assertTrue("the list has duplicated items" in str(e)) - def test_required_param_validation(self): try: self.pet_api.get_pet_by_id() # type: ignore