From 0407acbb172df1c2484fb4cf9776c14ef3f35cbf Mon Sep 17 00:00:00 2001 From: HolyMagician03-UMich Date: Sun, 7 Apr 2024 12:49:13 -0400 Subject: [PATCH] modified config stub in test_line_with_reprcrash to use verbose=0 --- testing/test_terminal.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 9c17708cc..501867bed 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2377,8 +2377,13 @@ def test_line_with_reprcrash(monkeypatch: MonkeyPatch) -> None: monkeypatch.setattr(_pytest.terminal, "_get_node_id_with_markup", mock_get_pos) + class Namespace: + def __init__(self, **kwargs): + self.__dict__.update(kwargs) + class config: - pass + def __init__(self): + object.__setattr__(self, "option", Namespace(verbose=0)) class rep: def _get_verbose_word(self, *args): @@ -2399,7 +2404,7 @@ def test_line_with_reprcrash(monkeypatch: MonkeyPatch) -> None: if msg: rep.longrepr.reprcrash.message = msg # type: ignore actual = _get_line_with_reprcrash_message( - config, # type: ignore[arg-type] + config(), # type: ignore[arg-type] rep(), # type: ignore[arg-type] DummyTerminalWriter(), # type: ignore[arg-type] {},