Skip to content

test.test_annotationlib.TestStringFormat.test_displays shouldn't rely on set's order of elements #133682

Closed

Description

@befeleme

Bug report

Bug description:

We've hit a failure during Python's 3.14.0b1 build - test apparently checks for an exact order of elements in a set which will sometimes fail:

FAIL: test_displays (test.test_annotationlib.TestStringFormat.test_displays)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python3.14-3.14.0_b1-build/Python-3.14.0b1/Lib/test/test_annotationlib.py", line 349, in test_displays
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        anno,
        ^^^^^
    ...<5 lines>...
        },
        ^^
    )
    ^
AssertionError: {'w':[29 chars] 'a[{str, int}, 3]', 'y': 'a[{int: str}, 4]', [19 chars] 5]'} != {'w':[29 chars] 'a[{int, str}, 3]', 'y': 'a[{int: str}, 4]', [19 chars] 5]'}
  {'w': 'a[[int, str], float]',
-  'x': 'a[{str, int}, 3]',
?              -----
+  'x': 'a[{int, str}, 3]',
?           +++++
   'y': 'a[{int: str}, 4]',
   'z': 'a[(int, str), 5]'}

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Activity

  1. self-assigned this
    on May 8, 2025
  2. JelleZijlstra commented on May 8, 2025

    @JelleZijlstra
    Member

    Surprised I never ran into this running the test locally. Should be fixable by making the test use a one-element set; I'll do this soon unless somebody else gets to it first.

  3. added
    testsTests in the Lib/test dir
    3.14bugs and security fixes
    on May 8, 2025
  4. added a commit that references this issue on May 9, 2025
  5. added a commit that references this issue on May 9, 2025
  6. added a commit that references this issue on May 9, 2025
  7. added a commit that references this issue on Jul 12, 2025
  8. added a commit that references this issue on Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.14bugs and security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions