def test_dataloader(self, test_type: str | TestType | None = None) -> EVAL_DATALOADERS:
        """Get test dataloader for the specified test type.

        Args:
            test_type (str | TestType | None, optional): Type of test set to use:
                - ``"public"``: Test set with ground truth for local evaluation
                - ``"private"``: Official test set without ground truth for leaderboard
                - ``"private_mixed"``: Official test set with mixed lighting conditions
                If None, uses the test_type specified in __init__.
                Defaults to None.

        Example:
            >>> datamodule.setup()
            >>> public_loader = datamodule.test_dataloader()  # returns loader based on test_type
            >>> private_loader = datamodule.test_dataloader(test_type="private")
            >>> mixed_loader = datamodule.test_dataloader(test_type="private_mixed")

        Returns:
            EVAL_DATALOADERS: Test dataloader for the specified test type.
        """
        test_type = test_type or self.test_type
        test_type = TestType(test_type) if isinstance(test_type, str) else test_type

        if test_type == TestType.PUBLIC:
            dataset = self.test_public_data
        elif test_type == TestType.PRIVATE:
            dataset = self.test_private_data
        elif test_type == TestType.PRIVATE_MIXED:
            dataset = self.test_private_mixed_data
        else:
            msg = f"Invalid test type: {test_type}. Must be one of {TestType.__members__.keys()}."
            raise ValueError(msg)

        return DataLoader(
            dataset=dataset,
            shuffle=False,
            batch_size=self.eval_batch_size,
            num_workers=self.num_workers,
            collate_fn=dataset.collate_fn,
        )
Get test dataloader for the specified test type.

        Args:
            test_type (str | TestType | None, optional): Type of test set to use:
                - ``"public"``: Test set with ground truth for local evaluation
                - ``"private"``: Official test set without ground truth for leaderboard
                - ``"private_mixed"``: Official test set with mixed lighting conditions
                If None, uses the test_type specified in __init__.
                Defaults to None.

        Example:
            >>> datamodule.setup()
            >>> public_loader = datamodule.test_dataloader()  # returns loader based on test_type
            >>> private_loader = datamodule.test_dataloader(test_type="private")
            >>> mixed_loader = datamodule.test_dataloader(test_type="private_mixed")

        Returns:
            EVAL_DATALOADERS: Test dataloader for the specified test type.
        
src/anomalib/data/datamodules/image/mvtecad2.py