def test_builtins_dedent_coverage(): s = ("if True:\n" " if True:\n" " min(d.keys())\n" " else:\n" " pass\n") # fmt:off expected = ("if True:\n" " if True:\n" " min(d)\n" " else:\n" " pass\n") # fmt:on assert _fix(s) == expected
def test_for_noop(s): assert _fix(s) == s
def test_for(s, expected): assert _fix(s) == expected
def test_zip_noop(s): assert _fix(s) == s
def test_zip(s, expected): assert _fix(s) == expected
def test_builtins(func): s = f"{func}(d.keys())" assert _fix(s) == f"{func}(d)"
def test_builtins_noop(s): assert _fix(s) == s
def test_comprehensions(s, expected): assert _fix(s) == expected
def test_builtins_complex(s, expected): assert _fix(s) == expected
def test_builtins_brace_counting(): s = "min(d((1, 2)).keys())" assert _fix(s) == "min(d((1, 2)))"
def test_in_noop(s): # don't have a great way to detect these assert _fix(s) == s
def test_join(s, expected): assert _fix(s) == expected
def test_builtins(func): s = f"{func}({{1: 2, 3: 4}}.keys())" assert _fix(s) == f"{func}({{1: 2, 3: 4}})"
def test_builtins_brace_counting(): s = "min({1: 2, 3: {4, \n5, 6}, 7: {8: 9}}.keys())" assert _fix(s) == "min({1: 2, 3: {4, \n5, 6}, 7: {8: 9}})"