8000 add tests for autofix files, fix 91x autofix, and rejig test files to… · python-trio/flake8-async@b3d8a6e · GitHub
[go: up one dir, main page]

Skip to content

Commit b3d8a6e

Browse files
committed
add tests for autofix files, fix 91x autofix, and rejig test files to accomodate the new tests
1 parent 220c405 commit b3d8a6e

19 files changed

+473
-415
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Tests are automatically generated for files in the `tests/eval_files/` directory
3535
### autofix files
3636
Checks that have autofixing can have a file in the `tests/autofix_files` directory matching the filename in `tests/eval_files`. The result of running the checker on the eval file with autofix enabled will then be compared to the content of the autofix file and will print a diff (if `-s` is on) and assert that the content is the same. `--generate-autofix` is added as a pytest flag to ease development, which will print a diff (with `-s`) and overwrite the content of the autofix file. Also see the magic line marker `pass # AUTOFIX_LINE ` below
3737

38+
#### `# AUTOFIX_NOFIX`
39+
Used when an eval_file has an autofix_file, but expects none of the content to get autofixed. When this line isn't present, autofix files are expected to raise no errors and not get modified upon getting rerun against the checker.
40+
3841
### `error:`
3942
Lines containing `error:` are parsed as expecting an error of the code matching the file name, with everything on the line after the colon `eval`'d and passed as arguments to `flake8_trio.Error_codes[<error_code>].str_format`. The `globals` argument to `eval` contains a `lineno` variable assigned the current line number, and the `flake8_trio.Statement` namedtuple. The first element after `error:` *must* be an integer containing the column where the error on that line originates.
4043
#### `TRIOxxx:`

0 commit comments

Comments
 (0)
< 2AF2 /div>
0