code: def __exit__(self, type, value, traceback):
      if self.rec:
          warnings = [w.category.__name__ for w in self.rec]
          joined = "\\n".join(warnings)
          raise AssertionError(
              "Function is marked as not warning but the following "
              "warnings were found: \n"
              f"{joined}"
          )
  
file_path: statsmodels/statsmodels/compat/pytest.py
imports: from __future__ import annotations
  import warnings
  from _pytest.recwarn import WarningsChecker
  from pytest import warns
label_desc: Use image node_id 3 for calling the NoWarningsChecker obj's underlying member method code with example usage: obj.__exit__(type, value, traceback) without return types