From 9adb539b84a8b716ef8b70bdc7b2e1d791c96b29 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 1 Aug 2025 08:32:44 -0400 Subject: [PATCH] Keep stats screen visible --- src/main.py | 10 ++-------- src/tests/test_stats_screen.py | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main.py b/src/main.py index 9b24a45..3a18c6c 100644 --- a/src/main.py +++ b/src/main.py @@ -295,10 +295,7 @@ def _display_live_stats( if not sys.stdin or not sys.stdin.isatty(): clear_screen() - if stats_mgr is not None: - stats_mgr.display_stats_once(password_manager) - else: - display_fn() + display_fn() note = get_notification_text(password_manager) if note: print(note) @@ -315,10 +312,7 @@ def _display_live_stats( except Exception: # pragma: no cover - sync best effort logging.debug("Background sync failed during stats display") clear_screen() - if stats_mgr is not None: - stats_mgr.display_stats_once(password_manager) - else: - display_fn() + display_fn() note = get_notification_text(password_manager) if note: print(note) diff --git a/src/tests/test_stats_screen.py b/src/tests/test_stats_screen.py index 6a76872..f7f6d4e 100644 --- a/src/tests/test_stats_screen.py +++ b/src/tests/test_stats_screen.py @@ -73,7 +73,7 @@ def test_stats_display_only_once(monkeypatch, capsys): monkeypatch.setattr(main, "timed_input", fake_input) main._display_live_stats(pm, interval=0.01) out = capsys.readouterr().out - assert out.count("stats") == 1 + assert out.count("stats") >= 1 def test_stats_display_resets_after_exit(monkeypatch, capsys):