Skip to content

Commit fb37fcc

Browse files
committed
[python] remove stale uniqueItems tests
Pydantic 2 removed conlist(unique_items=True). The migration in 04fa53b kept OpenAPI arrays as lists because sets would lose ordering and complicate JSON serialization, but left these tests behind. The tests do not require an exception, so they normally pass after making a Petstore request. They fail when that request produces an unrelated response validation error. Remove them from the two Pydantic 2 samples; the Pydantic 1 sample still exercises the supported validation.
1 parent 4a5f3a7 commit fb37fcc

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

‎samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ def setUpModels(self):
4040
self.pet.category = self.category
4141
self.pet.tags = [self.tag]
4242

43-
def test_set_param_validation(self):
44-
try:
45-
self.pet_api.find_pets_by_tags(["a", "a"])
46-
except ValidationError as e:
47-
self.assertTrue("the list has duplicated items" in str(e))
48-
4943
def test_required_param_validation(self):
5044
try:
5145
self.pet_api.get_pet_by_id() # type: ignore

‎samples/openapi3/client/petstore/python/tests/test_api_validation.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ def setUpModels(self):
4040
self.pet.category = self.category
4141
self.pet.tags = [self.tag]
4242

43-
def test_set_param_validation(self):
44-
try:
45-
self.pet_api.find_pets_by_tags(["a", "a"])
46-
except ValidationError as e:
47-
self.assertTrue("the list has duplicated items" in str(e))
48-
4943
def test_required_param_validation(self):
5044
try:
5145
self.pet_api.get_pet_by_id() # type: ignore

0 commit comments

Comments
 (0)