From dbbfe1e0b8478548686fca5bc73be7ec0e0c9148 Mon Sep 17 00:00:00 2001 From: anonymousdouble <112695649+anonymousdouble@users.noreply.github.com> Date: Thu, 4 Jan 2024 08:06:33 +1100 Subject: [PATCH] Update test_fix_pyre_directives.py (#1082) * Update test_fix_pyre_directives.py refactor with fstring to format string to make code more Pythonic. * Update test_fix_pyre_directives.py refactor with fstring to format string to make code more Pythonic. * Update test_fix_pyre_directives.py refactor with fstring to format string to make code more Pythonic. * Update test_fix_pyre_directives.py refactor with fstring to format string to make code more Pythonic. * Update test_fix_pyre_directives.py refactor with chain constant value assignment to make code more Pythonic * Update test_fix_pyre_directives.py refactor with chain constant value assignment to make code more Pythonic --- .../tests/test_fix_pyre_directives.py | 38 +++++-------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/libcst/codemod/commands/tests/test_fix_pyre_directives.py b/libcst/codemod/commands/tests/test_fix_pyre_directives.py index 2d07af125..4707073a9 100644 --- a/libcst/codemod/commands/tests/test_fix_pyre_directives.py +++ b/libcst/codemod/commands/tests/test_fix_pyre_directives.py @@ -14,14 +14,9 @@ def test_no_need_to_fix_simple(self) -> None: """ Tests that a pyre-strict inside the module header doesn't get touched. """ - before = """ - # pyre-strict - from typing import List - - def baz() -> List[Foo]: - pass - """ - after = """ + after = ( + before + ) = """ # pyre-strict from typing import List @@ -34,16 +29,9 @@ def test_no_need_to_fix_complex_bottom(self) -> None: """ Tests that a pyre-strict inside the module header doesn't get touched. """ - before = """ - # This is some header comment. - # - # pyre-strict - from typing import List - - def baz() -> List[Foo]: - pass - """ - after = """ + after = ( + before + ) = """ # This is some header comment. # # pyre-strict @@ -58,17 +46,9 @@ def test_no_need_to_fix_complex_top(self) -> None: """ Tests that a pyre-strict inside the module header doesn't get touched. """ - before = """ - # pyre-strict - # - # This is some header comment. - - from typing import List - - def baz() -> List[Foo]: - pass - """ - after = """ + after = ( + before + ) = """ # pyre-strict # # This is some header comment.