From d3f43af2bfb5815a21373e5a72830b18fa5b2884 Mon Sep 17 00:00:00 2001 From: Ilya Priven Date: Wed, 31 May 2023 23:20:24 -0400 Subject: [PATCH] --update-data should not touch xfail tests --- mypy/test/testupdatedata.py | 6 ++++++ mypy/test/update_data.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/mypy/test/testupdatedata.py b/mypy/test/testupdatedata.py index 2e86c641ce6d..2a6d2462f10c 100644 --- a/mypy/test/testupdatedata.py +++ b/mypy/test/testupdatedata.py @@ -46,6 +46,9 @@ def test_update_data(self) -> None: [case testWrong] s: str = 42 # E: wrong error + [case testXfail-xfail] + s: str = 42 # E: wrong error + [case testWrongMultiline] s: str = 42 # E: foo \ # N: bar @@ -101,6 +104,9 @@ def test_update_data(self) -> None: [case testWrong] s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") + [case testXfail-xfail] + s: str = 42 # E: wrong error + [case testWrongMultiline] s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") diff --git a/mypy/test/update_data.py b/mypy/test/update_data.py index b37b440de38f..2d66752f61bd 100644 --- a/mypy/test/update_data.py +++ b/mypy/test/update_data.py @@ -10,6 +10,8 @@ def update_testcase_output( testcase: DataDrivenTestCase, actual: list[str], *, incremental_step: int ) -> None: + if testcase.xfail: + return collector = testcase.parent assert isinstance(collector, DataFileCollector) for fix in _iter_fixes(testcase, actual, incremental_step=incremental_step):