code: def pytest_collection(session):
      # this hook is only called when test modules are collected
      # so for example not in the master process of pytest-xdist
      # (which does not collect test modules)
      assertstate = getattr(session.config, "_assertstate", None)
      if assertstate:
          if assertstate.hook is not None:
              assertstate.hook.set_session(session)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import six
  from _pytest.assertion import rewrite
  from _pytest.assertion import truncate
  from _pytest.assertion import util
label_desc: Use image node_id 4 for calling a global function with example usage: pytest_collection(session) without return types