code: def test_print_groups(resources, capsys):
      batch_file = os.path.join(resources, "batch_data.h5")
  
      cellprofiler.__main__.print_groups(batch_file)
  
      print_groups_str = capsys.readouterr()[0].strip()
      print_groups = eval(print_groups_str)
  
      assert len(print_groups) == 9
  
      for i, g in enumerate(print_groups):
          # Assert only 1 image per group
          assert len(g[1]) == 1
  
          imnr = g[1][0]
          # Assert internal consistency between group metadata and image number
          assert int(g[0]["ImageNumber"]) == imnr
          # Assert order correctly
          assert i + 1 == imnr
  
file_path: CellProfiler/tests/frontend/test_main.py
imports: import os.path
  import re
  import pytest
  import cellprofiler.__main__
  import tests.frontend
label_desc: Use image node_id 5 for calling a global function with example usage: test_print_groups(resources, capsys) without return types