Skip to content

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

Closed
@befeleme

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

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