#
#
from __future__ import annotations
import pytest
from airflow.exceptions import SerializationError
from tests import REPO_ROOT
def test_recursive_serialize_calls_must_forward_kwargs():
    """Any time we recurse cls.serialize, we must forward all kwargs."""
    import ast
    valid_recursive_call_count = 0
    file = REPO_ROOT / "airflow/serialization/serialized_objects.py"
    content = file.read_text()
    tree = ast.parse(content)
    class_def = None
    for stmt in ast.walk(tree):
        if not isinstance(stmt, ast.ClassDef):
            continue
        if stmt.name == "BaseSerialization":
            class_def = stmt
    method_def = None
    for elem in ast.walk(class_def):