[python] fix uniqueItems validation tests

Merged
TA
4mo ago
+3-15

Pydantic 2 removed conlist(unique_items=True). The migration in
04fa53b6 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.


Summary by cubic

Remove duplicate-item validation tests from Petstore samples on python and python-lazyImports (Pydantic v2) to align with removal of conlist(unique_items=True) and eliminate flaky failures. In python-pydantic-v1, require the expected ValidationError with assertRaisesRegex("the list has duplicated items") to prevent silent regressions.