Skip to content

Commit

Permalink
--update-data should not touch xfail tests (#15337)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst authored Jun 1, 2023
1 parent d11db28 commit c0af000
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mypy/test/testupdatedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions mypy/test/update_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c0af000

Please sign in to comment.