From 94e5df4ee6480edf5061369fec6927c1859b7348 Mon Sep 17 00:00:00 2001 From: Charlie Denton Date: Fri, 31 Mar 2023 23:30:08 +0100 Subject: [PATCH] Test run-running dmypy after a file is altered These tests show how some errors disappear on a re-run of dmypy after a file is altered. Co-authored-by: David Seddon --- test-data/unit/fine-grained.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test-data/unit/fine-grained.test b/test-data/unit/fine-grained.test index 165a2089b4667..ed3b9d90c1c31 100644 --- a/test-data/unit/fine-grained.test +++ b/test-data/unit/fine-grained.test @@ -10505,3 +10505,27 @@ from pkg.sub import modb [out] == + +[case testUnusedTypeIgnorePreservedAfterChange] +# flags: --warn-unused-ignores --no-error-summary +[file main.py] +a = 1 # type: ignore +[file main.py.2] +a = 1 # type: ignore +# Comment to trigger reload. +[out] +main.py:1: error: Unused "type: ignore" comment +== +main.py:1: error: Unused "type: ignore" comment + +[case testTypeIgnoreWithoutCodePreservedAfterChange] +# flags: --enable-error-code ignore-without-code --no-error-summary +[file main.py] +a = 1 # type: ignore +[file main.py.2] +a = 1 # type: ignore +# Comment to trigger reload. +[out] +main.py:1: error: "type: ignore" comment without error code +== +main.py:1: error: "type: ignore" comment without error code