We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2a0345 commit 589fbc7Copy full SHA for 589fbc7
Lib/test/test_struct.py
@@ -7,7 +7,6 @@
7
import unittest
8
import struct
9
import sys
10
-import warnings
11
import weakref
12
13
from test import support
@@ -578,9 +577,10 @@ def test_Struct_reinitialization(self):
578
577
s = struct.Struct('i')
579
with self.assertWarns(DeprecationWarning):
580
s.__init__('ii')
581
- with warnings.catch_warnings():
582
- warnings.simplefilter("error", DeprecationWarning)
583
- self.assertRaises(DeprecationWarning, s.__init__, 'ii')
+ self.assertEqual(s.format, 'ii')
+ packed = b'\x01\x00\x00\x00\x02\x00\x00\x00'
+ self.assertEqual(s.pack(1, 2), packed)
+ self.assertEqual(s.unpack(packed), (1, 2))
584
585
def check_sizeof(self, format_str, number_of_codes):
586
# The size of 'PyStructObject'
0 commit comments