MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_issue29802

Method test_issue29802

Lib/test/test_struct.py:669–676  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

667 struct.unpack_from('<I', bytearray(10), sys.maxsize)
668
669 def test_issue29802(self):
670 # When the second argument of struct.unpack() was of wrong type
671 # the Struct object was decrefed twice and the reference to
672 # deallocated object was left in a cache.
673 with self.assertRaises(TypeError):
674 struct.unpack('b', 0)
675 # Shouldn't crash.
676 self.assertEqual(struct.unpack('b', b'a'), (b'a'[0],))
677
678 def test_format_attr(self):
679 s = struct.Struct('=i2H')

Callers

nothing calls this directly

Calls 3

assertRaisesMethod · 0.45
unpackMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected