def _count_tests_in_file(self, file_path: pathlib.Path) -> int:
        """
        Count the number of test functions in a Python file.
        Looks for functions that start with 'test_' or methods in classes that start with 'Test'.
        """
        try:
            with open(file_path, encoding="utf-8") as f:
                tree = ast.parse(f.read())

            test_count = 0

            for node in ast.walk(tree):
                # Count standalone test functions
                if isinstance(node, ast.FunctionDef) and node.name.startswith("test_"):
                    test_count += 1

                # Count test methods in test classes
                elif isinstance(node, ast.ClassDef) and node.name.startswith("Test"):
                    test_methods = [
                        method
                        for method in node.body
                        if isinstance(method, ast.FunctionDef)
                        and (method.name.startswith("test_") or method.name == "test")
                    ]
                    test_count += len(test_methods)

            return test_count
        except Exception:
            # If we can't parse the file, return 0
            return 0

        Count the number of test functions in a Python file.
        Looks for functions that start with 'test_' or methods in classes that start with 'Test'.
        
scripts/integration_health_check.py