Skip to content

--update-data should not touch xfail tests #15337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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