def test_dataclass_no_attribute() -> None:
    """Regression test for https://github.com/Textualize/rich/issues/3417"""
    from dataclasses import dataclass, field

    @dataclass(eq=False)
    class BadDataclass:
        item: int = field(init=False)

    # item is not provided
    bad_data_class = BadDataclass()

    console = Console()
    with console.capture() as capture:
        console.print(bad_data_class)

    expected = "BadDataclass()\n"
    result = capture.get()
    assert result == expected
Regression test for https://github.com/Textualize/rich/issues/3417
tests/test_pretty.py