code: def _ensure_all_posteriors_are_tested_fixture(
      tested_posteriors: DefaultDict[str, Set[Type[AbstractPosterior]]]
  ) -> Iterable[None]:
      """
      This fixture ensures that all concrete posteriors have unit tests which compare the predictions
      from the fused and precomputed code paths. When adding a new concrete posterior class to
      GPFlow, ensure that it is also tested in this manner.
  
      This autouse, package scoped fixture will always be executed when tests in this package are run.
      """
      # Code here will be executed before any of the tests in this package.
  
      yield  # Run tests in this package.
  
      # Code here will be executed after all of the tests in this package.
  
      available_posteriors = list(
          gpflow.ci_utils.subclasses(AbstractPosterior)
      )
      concrete_posteriors = set(
          [k for k in available_posteriors if not isabstract(k)]
      )
  
      messages = []
      for key, key_tested_posteriors in tested_posteriors.items():
          untested_posteriors = (
              concrete_posteriors - key_tested_posteriors
          )
          if untested_posteriors:
              messages.append(
                  f"For key '{key}' no tests have been registered for the following posteriors: {untested_posteriors}."
              )
  
      if messages:
          raise AssertionError("\n".join(messages))
  
imports: from inspect import isabstract
  from typing import DefaultDict, Iterable, Set, Type
  import pytest
  import gpflow.ci_utils
  from gpflow.posteriors import AbstractPosterior
label_desc: Use image node_id 2 for calling a global function with example usage: _ensure_all_posteriors_are_tested_fixture(tested_posteriors) without return types