black/tests
Richard Si 8a59528c2d
Stop changing return type annotations to tuples (#2384)
This fixes a bug where a trailing comma would be added to a
parenthesized return annotation changing its type to a tuple.
Here's one case where this bug shows up:

```
def spam() -> (
    this_is_a_long_type_annotation_which_should_NOT_get_a_trailing_comma
):
    pass
```

The root problem was that the type annotation was treated as if it was
a parameter & import list (is_body=True to linegen::bracket_split_build_line)
where a trailing comma is usually fine. Now there's another check in the
aforementioned function to make sure the body it's operating on isn't
a return annotation before truly adding a trailing comma.
2021-08-25 18:32:27 -07:00
..
data Stop changing return type annotations to tuples (#2384) 2021-08-25 18:32:27 -07:00
__init__.py Remove deprecated use of 'setup.py test' (#1275) 2020-05-08 06:23:50 -07:00
conftest.py Use optional tests for "no_python2" to simplify local testing (#2203) 2021-05-07 15:03:13 +02:00
empty.toml Add --target-version option to allow users to choose targeted Python versions (#618) 2019-02-06 18:43:50 -08:00
optional.py Use optional tests for "no_python2" to simplify local testing (#2203) 2021-05-07 15:03:13 +02:00
test_black.py Present a more user-friendly error if .gitignore is invalid (#2414) 2021-08-20 19:54:53 -04:00
test_blackd.py Mark blackd tests with the blackd optional marker (#2204) 2021-05-07 16:33:36 +02:00
test_format.py Possible fix for issue with indentation and fmt: skip (#2281) 2021-06-08 14:37:34 -07:00
test_ipynb.py Jupyter notebook support (#2357) 2021-08-06 16:57:46 -04:00
test_no_ipynb.py Jupyter notebook support (#2357) 2021-08-06 16:57:46 -04:00
test_primer.py Add cpython Lib/ repository config into primer config - Disabled (#2429) 2021-08-24 17:29:49 -04:00
test.toml Switch toml TOML library for tomli (#2301) 2021-07-12 16:01:38 -04:00
util.py add context manager to temporarily change the cwd (#2377) 2021-07-16 22:21:34 -04:00