def test_init_aliases(self):
        """Check that all trulens_eval.*.__init__ aliases are still usable
        produce deprecation messages when used.

        Also checks that importing the module itself produces a deprecation
        warning.
        """

        for modname, names in self.trulens_eval_modules.items():
            with self.subTest(modname=modname):
                # Make sure importing the module shows a warning:
                with self.subTest("module deprecation warning"):
                    with self.assertWarns(DeprecationWarning):
                        mod = None
                        if modname in sys.modules:
                            # Delete the module in case already imported. This
                            # is to catch the deprecation warning which only
                            # occurs the first time it is imported.
                            del sys.modules[modname]

                        mod = importlib.import_module(
                            modname,
                        )

                if mod is None:
                    continue

                for name in names:
                    if name in [
                        "Cortex",
                        "CortexEndpoint",
                        "TruRails",
                    ] and sys.version_info >= (3, 12):
                        # These require python < 3.12 .
                        continue

                    with self.subTest(name=name):
                        # Can get the named object from module:
                        self.assertTrue(
                            hasattr(mod, name),
                            f"Module {modname} does not have alias {name}.",
                        )

                        val = getattr(mod, name)

                        if inspect.isclass(val) and issubclass(val, Enum):
                            # The deprecation warning scheme does not work for Enums.
                            continue

                        # NOTE(piotrm): temporarily disabling this test as the
                        # deprecation mechanism being tested had to be disabled
                        # due to an unsolved interaction with feedback function
                        # serialization.
                        """
                        with self.subTest("alias call deprecation warning"):
                            with self.assertWarns(DeprecationWarning):
                                # try calling it:
                                try:
                                    val()  # will most likely fail, but should do so after the deprecation message
                                except BaseException:
                                    pass
                        """
Check that all trulens_eval.*.__init__ aliases are still usable
        produce deprecation messages when used.

        Also checks that importing the module itself produces a deprecation
        warning.
        
tests/unit/static/test_deprecation.py