code: def test_cached_property() -> None:
      ncalls = 0
  
      class Class:
          @cached_property
          def prop(self) -> int:
              nonlocal ncalls
              ncalls += 1
              return ncalls
  
      c1 = Class()
      assert ncalls == 0
      assert c1.prop == 1
      assert c1.prop == 1
      c2 = Class()
      assert ncalls == 1
      assert c2.prop == 2
      assert c1.prop == 1
  
imports: import enum
  import sys
  from functools import cached_property
  from functools import partial
  from functools import wraps
  from typing import TYPE_CHECKING
  from typing import Union
  import pytest
  from _pytest.compat import _PytestWrapper
  from _pytest.compat import assert_never
  from _pytest.compat import get_real_func
  from _pytest.compat import is_generator
  from _pytest.compat import safe_getattr
  from _pytest.compat import safe_isclass
  from _pytest.outcomes import OutcomeException
  from _pytest.pytester import Pytester
label_desc: Use image node_id 11 for calling a global function with example usage: test_cached_property() and returns: ncalls