Skip to content

Commit 5cd1c93

Browse files
Adapt to OrderedDict repr change in Python 3.12
python/cpython#101661
1 parent 3e67b38 commit 5cd1c93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_printing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Test suite for printing.
44
"""
55
# Standard library imports ...
6+
from collections import OrderedDict
67
import importlib.resources as ir
78
from io import BytesIO, StringIO
89
import struct
@@ -1058,6 +1059,9 @@ def test_exif_uuid(self):
10581059

10591060
actual = str(j.box[5])
10601061

1062+
# Python 3.12: gh-101446: Change repr of collections.OrderedDict
1063+
# https://github.com/python/cpython/pull/101661
1064+
exif_val = OrderedDict([('Make', 'HTC')])
10611065
expected = (
10621066
"UUID Box (uuid) @ (1135519, 142)\n"
10631067
" UUID: 4a706754-6966-6645-7869-662d3e4a5032 (EXIF)\n"
@@ -1066,7 +1070,7 @@ def test_exif_uuid(self):
10661070
" ( 'TileOffsets',\n"
10671071
" "
10681072
"array([ 0, 10, 20, ..., 70, 80, 90], dtype=uint32)),\n"
1069-
" ('ExifTag', OrderedDict([('Make', 'HTC')]))])"
1073+
f" ('ExifTag', {exif_val!r})])"
10701074
)
10711075
self.assertEqual(actual, expected)
10721076

0 commit comments

Comments
 (0)