From d1789dd93b32d0148be3faa6fea1da92d700e74d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 1 Aug 2024 10:21:49 -0700 Subject: [PATCH] format --- tests/test_tokenize.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_tokenize.py b/tests/test_tokenize.py index 1794533b782..71773069546 100644 --- a/tests/test_tokenize.py +++ b/tests/test_tokenize.py @@ -60,7 +60,7 @@ def test_fstring() -> None: 'f"x"', [ Token("FSTRING_START", 'f"', (1, 0), (1, 2)), - Token("FSTRING_MIDDLE", 'x', (1, 2), (1, 3)), + Token("FSTRING_MIDDLE", "x", (1, 2), (1, 3)), Token("FSTRING_END", '"', (1, 3), (1, 4)), Token("ENDMARKER", "", (2, 0), (2, 0)), ], @@ -69,11 +69,11 @@ def test_fstring() -> None: 'f"{x}"', [ Token("FSTRING_START", 'f"', (1, 0), (1, 2)), - Token("FSTRING_MIDDLE", '', (1, 2), (1, 2)), - Token("LBRACE", '{', (1, 2), (1, 3)), + Token("FSTRING_MIDDLE", "", (1, 2), (1, 2)), + Token("LBRACE", "{", (1, 2), (1, 3)), Token("NAME", "x", (1, 3), (1, 4)), - Token("RBRACE", '}', (1, 4), (1, 5)), - Token("FSTRING_MIDDLE", '', (1, 5), (1, 5)), + Token("RBRACE", "}", (1, 4), (1, 5)), + Token("FSTRING_MIDDLE", "", (1, 5), (1, 5)), Token("FSTRING_END", '"', (1, 5), (1, 6)), Token("ENDMARKER", "", (2, 0), (2, 0)), ], @@ -110,9 +110,10 @@ def test_fstring() -> None: ) +# Run "echo some code | python tests/test_tokenize.py" to generate test cases. if __name__ == "__main__": code = sys.stdin.read() tokens = get_tokens(code) text = f"assert_tokenizes({code!r}, {tokens!r})" - text = black.format_str(text, mode=black.FileMode()) + text = black.format_str(text, mode=black.Mode()) print(textwrap.indent(text, " "))