Skip to content

Commit c0af000

Browse files
authored
--update-data should not touch xfail tests (#15337)
1 parent d11db28 commit c0af000

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

mypy/test/testupdatedata.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def test_update_data(self) -> None:
4646
[case testWrong]
4747
s: str = 42 # E: wrong error
4848
49+
[case testXfail-xfail]
50+
s: str = 42 # E: wrong error
51+
4952
[case testWrongMultiline]
5053
s: str = 42 # E: foo \
5154
# N: bar
@@ -101,6 +104,9 @@ def test_update_data(self) -> None:
101104
[case testWrong]
102105
s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str")
103106
107+
[case testXfail-xfail]
108+
s: str = 42 # E: wrong error
109+
104110
[case testWrongMultiline]
105111
s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str")
106112

mypy/test/update_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
def update_testcase_output(
1111
testcase: DataDrivenTestCase, actual: list[str], *, incremental_step: int
1212
) -> None:
13+
if testcase.xfail:
14+
return
1315
collector = testcase.parent
1416
assert isinstance(collector, DataFileCollector)
1517
for fix in _iter_fixes(testcase, actual, incremental_step=incremental_step):

0 commit comments

Comments
 (0)