]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133682: Fix inconsistent set ordering in annotationlib test (#133702)
authorAkshat Gupta <akshat.gupta24@gmail.com>
Fri, 9 May 2025 14:01:01 +0000 (19:31 +0530)
committerGitHub <noreply@github.com>
Fri, 9 May 2025 14:01:01 +0000 (07:01 -0700)
Lib/test/test_annotationlib.py
Misc/NEWS.d/next/Tests/2025-05-09-04-11-06.gh-issue-133682.-_lwo3.rst [new file with mode: 0644]

index 4af97c82de9d46738e64c9147232bf3899e56d95..73a821d15e3481de63f3a0a6c8c8bbc346435e92 100644 (file)
@@ -378,7 +378,7 @@ class TestStringFormat(unittest.TestCase):
 
         def g(
             w: a[[int, str], float],
-            x: a[{int, str}, 3],
+            x: a[{int}, 3],
             y: a[{int: str}, 4],
             z: a[(int, str), 5],
         ):
@@ -388,7 +388,7 @@ class TestStringFormat(unittest.TestCase):
             anno,
             {
                 "w": "a[[int, str], float]",
-                "x": "a[{int, str}, 3]",
+                "x": "a[{int}, 3]",
                 "y": "a[{int: str}, 4]",
                 "z": "a[(int, str), 5]",
             },
diff --git a/Misc/NEWS.d/next/Tests/2025-05-09-04-11-06.gh-issue-133682.-_lwo3.rst b/Misc/NEWS.d/next/Tests/2025-05-09-04-11-06.gh-issue-133682.-_lwo3.rst
new file mode 100644 (file)
index 0000000..ebd17f7
--- /dev/null
@@ -0,0 +1 @@
+Fixed test case ``test.test_annotationlib.TestStringFormat.test_displays`` which ensures proper handling of complex data structures (lists, sets, dictionaries, and tuples) in string annotations.