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):