class_docstr: Tests for iterative unpacking (struct.Struct.iter_unpack).
code: def test_construct(self):
      def _check_iterator(it):
          self.assertIsInstance(it, abc.Iterator)
          self.assertIsInstance(it, abc.Iterable)
  
      s = struct.Struct(">ibcp")
      it = s.iter_unpack(b"")
      _check_iterator(it)
      it = s.iter_unpack(b"1234567")
      _check_iterator(it)
      # Wrong bytes length
      with self.assertRaises(struct.error):
          s.iter_unpack(b"123456")
      with self.assertRaises(struct.error):
          s.iter_unpack(b"12345678")
      # Zero-length struct
      s = struct.Struct(">")
      with self.assertRaises(struct.error):
          s.iter_unpack(b"")
      with self.assertRaises(struct.error):
          s.iter_unpack(b"12")
  
imports: from collections import abc
  import array
  import gc
  import math
  import operator
  import unittest
  import struct
  import sys
  import weakref
  from test import support
  from test.support import import_helper
  from test.support.script_helper import assert_python_ok
label_desc: Use image node_id 1 for calling the UnpackIteratorTest obj's underlying member method code with example usage: obj.test_construct() without return types