(self)
| 18 | |
| 19 | class UpdateDataSuite(Suite): |
| 20 | def test_update_data(self) -> None: |
| 21 | # Note: We test multiple testcases rather than 'test case per test case' |
| 22 | # so we could also exercise rewriting multiple testcases at once. |
| 23 | result = _run_pytest_update_data(""" |
| 24 | [case testCorrect] |
| 25 | s: str = 42 # E: Incompatible types in assignment (expression has type "int", variable has type "str") |
| 26 | |
| 27 | [case testWrong] |
| 28 | s: str = 42 # E: wrong error |
| 29 | |
| 30 | [case testXfail-xfail] |
| 31 | s: str = 42 # E: wrong error |
| 32 | |
| 33 | [case testWrongMultiline] |
| 34 | s: str = 42 # E: foo \ |
| 35 | # N: bar |
| 36 | |
| 37 | [case testMissingMultiline] |
| 38 | s: str = 42; i: int = 'foo' |
| 39 | |
| 40 | [case testExtraneous] |
| 41 | s: str = 'foo' # E: wrong error |
| 42 | |
| 43 | [case testExtraneousMultiline] |
| 44 | s: str = 'foo' # E: foo \ |
| 45 | # E: bar |
| 46 | |
| 47 | [case testExtraneousMultilineNonError] |
| 48 | s: str = 'foo' # W: foo \ |
| 49 | # N: bar |
| 50 | |
| 51 | [case testOutCorrect] |
| 52 | s: str = 42 |
| 53 | [out] |
| 54 | main:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") |
| 55 | |
| 56 | [case testOutWrong] |
| 57 | s: str = 42 |
| 58 | [out] |
| 59 | main:1: error: foobar |
| 60 | |
| 61 | [case testOutWrongIncremental] |
| 62 | s: str = 42 |
| 63 | [out] |
| 64 | main:1: error: foobar |
| 65 | [out2] |
| 66 | main:1: error: foobar |
| 67 | |
| 68 | [case testWrongMultipleFiles] |
| 69 | import a, b |
| 70 | s: str = 42 # E: foo |
| 71 | [file a.py] |
| 72 | s1: str = 42 # E: bar |
| 73 | [file b.py] |
| 74 | s2: str = 43 # E: baz |
| 75 | [builtins fixtures/list.pyi] |
| 76 | """) |
| 77 |
nothing calls this directly
no test coverage detected