From 01c0a3e960c3f0349aa2ecb17659b650f0969d2e Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 16 Dec 2025 12:24:54 +0100 Subject: [PATCH] [ty] Fix benchmark assertion (#22003) --- scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py b/scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py index fde0c433c4..3a66a15e58 100644 --- a/scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py +++ b/scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py @@ -376,6 +376,10 @@ class IncrementalEditTest(LspTest): "The after edit diagnostics should be initialized if the test ran at least once. Did you forget to call `run`?" ) + new_diagnostics = diff_diagnostics( + self.before_edit_diagnostics, self.after_edit_diagnostics + ) + before_edit_count = sum( len(diagnostics) for _, diagnostics in self.before_edit_diagnostics ) @@ -384,7 +388,7 @@ class IncrementalEditTest(LspTest): len(diagnostics) for _, diagnostics in self.after_edit_diagnostics ) - assert after_edit_count > before_edit_count, ( + assert len(new_diagnostics) > 0, ( f"Expected more diagnostics after the change. " f"Initial: {before_edit_count}, After change: {after_edit_count}" )