mirror of
https://github.com/python/cpython.git
synced 2025-10-28 01:00:34 +00:00
gh-107406: Add better struct.Struct repr (#107407)
This commit is contained in:
parent
8ba4714611
commit
e407cea193
4 changed files with 29 additions and 0 deletions
|
|
@ -774,6 +774,10 @@ class StructTest(unittest.TestCase):
|
|||
test_error_propagation('N')
|
||||
test_error_propagation('n')
|
||||
|
||||
def test_repr(self):
|
||||
s = struct.Struct('=i2H')
|
||||
self.assertEqual(repr(s), f'Struct({s.format!r})')
|
||||
|
||||
class UnpackIteratorTest(unittest.TestCase):
|
||||
"""
|
||||
Tests for iterative unpacking (struct.Struct.iter_unpack).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue