def test_pep695_with_class(create_module):
    """Primarily to ensure that the syntax is accepted and doesn't raise a `NameError` with `T`.
    The validation is not expected to work properly when parameterized at this point."""

    for import_annotations in ('from __future__ import annotations', ''):
        module = create_module(
            f"""
{import_annotations}
from pydantic import validate_call

class A[T]:
    @validate_call(validate_return=True)
    def f(self, a: T) -> T:
        return str(a)
            """
        )
        A = module.A
        a = A[int]()
        # these two are undesired behavior, but it's what happens now
        assert a.f(1) == '1'
        assert a.f('1') == '1'
Primarily to ensure that the syntax is accepted and doesn't raise a `NameError` with `T`.
    The validation is not expected to work properly when parameterized at this point.
tests/test_validate_call.py