Skip to content

Commit

Permalink
Merge pull request #875 from DrGFreeman/866-unique-items-more-than-two
Browse files Browse the repository at this point in the history
Ensure all elements of arrays are verified for uniqueness
  • Loading branch information
Julian authored Nov 4, 2021
2 parents ed4693c + 1085b27 commit 4a2232a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 61 deletions.
3 changes: 2 additions & 1 deletion jsonschema/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def uniq(container):
sliced = itertools.islice(sort, 1, None)

for i, j in zip(sort, sliced):
return not _sequence_equal(i, j)
if _sequence_equal(i, j):
return False

except (NotImplementedError, TypeError):
seen = []
Expand Down
60 changes: 0 additions & 60 deletions jsonschema/tests/test_jsonschema_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,6 @@ def leap_second(test):
narrow_unicode_build(test)
or missing_format(draft3_format_checker)(test)
or complex_email_validation(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of more than two arrays is invalid",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of strings is invalid",
)(test)
or skip(
message=bug(371),
subject="ref",
Expand All @@ -200,16 +190,6 @@ def leap_second(test):
or leap_second(test)
or missing_format(draft4_format_checker)(test)
or complex_email_validation(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of more than two arrays is invalid",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of strings is invalid",
)(test)
or skip(
message=bug(),
subject="ref",
Expand Down Expand Up @@ -271,16 +251,6 @@ def leap_second(test):
or leap_second(test)
or missing_format(draft6_format_checker)(test)
or complex_email_validation(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of more than two arrays is invalid",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of strings is invalid",
)(test)
or skip(
message=bug(371),
subject="ref",
Expand Down Expand Up @@ -320,16 +290,6 @@ def leap_second(test):
or leap_second(test)
or missing_format(draft7_format_checker)(test)
or complex_email_validation(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of more than two arrays is invalid",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of strings is invalid",
)(test)
or skip(
message=bug(371),
subject="ref",
Expand Down Expand Up @@ -396,16 +356,6 @@ def leap_second(test):
message="unevaluatedItems is different in 2019-09 (needs work).",
subject="unevaluatedItems",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of more than two arrays is invalid",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of strings is invalid",
)(test)
or skip(
message="dynamicRef support isn't working yet.",
subject="recursiveRef",
Expand Down Expand Up @@ -450,16 +400,6 @@ def leap_second(test):
Validator=Draft202012Validator,
skip=lambda test: (
narrow_unicode_build(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of more than two arrays is invalid",
)(test)
or skip(
message=bug(866),
subject="uniqueItems",
description="non-unique array of strings is invalid",
)(test)
or skip(
message="dynamicRef support isn't working yet.",
subject="dynamicRef",
Expand Down

0 comments on commit 4a2232a

Please sign in to comment.