def test_reset_with_mutables():
    """Calling reset should always reset fields to a copy of the defaults."""
    default = [[0, 0], [0, 1], [1, 1]]
    copied_default = copy.deepcopy(default)

    class MutableResetState(BaseState):
        items: list[list[int]] = default

    instance = MutableResetState()
    assert instance.items.__wrapped__ is not default  # pyright: ignore [reportAttributeAccessIssue]
    assert instance.items == default == copied_default
    instance.items.append([3, 3])
    assert instance.items != default
    assert instance.items != copied_default

    instance.reset()
    assert instance.items.__wrapped__ is not default  # pyright: ignore [reportAttributeAccessIssue]
    assert instance.items == default == copied_default
    instance.items.append([3, 3])
    assert instance.items != default
    assert instance.items != copied_default

    instance.reset()
    assert instance.items.__wrapped__ is not default  # pyright: ignore [reportAttributeAccessIssue]
    assert instance.items == default == copied_default
    instance.items.append([3, 3])
    assert instance.items != default
    assert instance.items != copied_default
Calling reset should always reset fields to a copy of the defaults.
tests/units/test_state.py