code: def test_max_depth_dataclass():
      @dataclass
      class Foo:
          foo: object
  
      @dataclass
      class Bar:
          bar: object
  
      assert (
          pretty_repr(Foo(foo=Bar(bar=Foo(foo=[]))), max_depth=2)
          == "Foo(foo=Bar(bar=Foo(...)))"
      )
  
imports: import collections
  import io
  import sys
  from array import array
  from collections import UserDict, defaultdict
  from dataclasses import dataclass, field
  from typing import Any, List, NamedTuple
  import attr
  import pytest
  from rich.console import Console
  from rich.measure import Measurement
  from rich.pretty import Node, Pretty, _ipy_display_hook, install, pprint, pretty_repr
  from rich.text import Text
label_desc: Use image node_id 29 for calling a global function with example usage: test_max_depth_dataclass() without return types