black/tests
Richard Si db30456916
Don't strip parens in assert / return with assign expr (#2143)
Black would previously strip the parenthesis away from statements like this these ones:

    assert (spam := 12 + 1)
    return (cheese := 1 - 12)

Which happens to be invalid code. Now before making the parenthesis invisible, Black
checks if the assignment expression's parent is an assert stamtment, aborting if True.

Raise, yield, and await are already handled fine.

I added a bunch of test cases from the PEP defining asssignment expressions (PEP 572).
2021-04-26 08:28:42 -07:00
..
data Don't strip parens in assert / return with assign expr (#2143) 2021-04-26 08:28:42 -07:00
__init__.py Remove deprecated use of 'setup.py test' (#1275) 2020-05-08 06:23:50 -07:00
empty.toml Add --target-version option to allow users to choose targeted Python versions (#618) 2019-02-06 18:43:50 -08:00
test_black.py fix magic comma and experimental string cache flags (#2131) 2021-04-26 07:46:48 +02:00
test_blackd.py Switch to pytest and tox (#1763) 2020-10-19 10:35:26 -07:00
test_format.py fix magic comma and experimental string cache flags (#2131) 2021-04-26 07:46:48 +02:00
test_primer.py Capture CalledProcessError for any postitive returncode (#1450) 2020-05-22 12:16:31 -07:00
test.toml Fix toml parsing and bump toml from 0.10.0 to 0.10.1 (#1501) 2020-06-16 11:58:33 -07:00
util.py fix magic comma and experimental string cache flags (#2131) 2021-04-26 07:46:48 +02:00