Skip to content

Commit

Permalink
Reenable RemoveUnneccessaryFStr
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Mar 15, 2024
1 parent 1cb7533 commit d331017
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
5 changes: 0 additions & 5 deletions integration_tests/test_unnecessary_f_str.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

from codemodder.codemods.test import (
BaseIntegrationTest,
original_and_expected_from_code_path,
Expand All @@ -10,9 +8,6 @@
)


@pytest.mark.skipif(
True, reason="May fail if it runs after test_sql_parameterization. See Issue #378."
)
class TestFStr(BaseIntegrationTest):
codemod = RemoveUnnecessaryFStr
code_path = "tests/samples/unnecessary_f_str.py"
Expand Down
5 changes: 2 additions & 3 deletions src/core_codemods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
from .remove_debug_breakpoint import RemoveDebugBreakpoint
from .remove_future_imports import RemoveFutureImports
from .remove_module_global import RemoveModuleGlobal

# from .remove_unnecessary_f_str import RemoveUnnecessaryFStr
from .remove_unnecessary_f_str import RemoveUnnecessaryFStr
from .remove_unused_imports import RemoveUnusedImports
from .replace_flask_send_file import ReplaceFlaskSendFile
from .requests_verify import RequestsVerify
Expand Down Expand Up @@ -89,7 +88,7 @@
OrderImports,
ProcessSandbox,
RemoveFutureImports,
# RemoveUnnecessaryFStr, # Temporarely disabled due to potential error. See Issue #378.
RemoveUnnecessaryFStr,
RemoveUnusedImports,
RequestsVerify,
SecureFlaskCookie,
Expand Down
11 changes: 0 additions & 11 deletions tests/codemods/test_remove_unnecessary_f_str.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import pytest

from codemodder.codemods.test import BaseCodemodTest
from core_codemods.remove_unnecessary_f_str import RemoveUnnecessaryFStr


class TestFStr(BaseCodemodTest):
codemod = RemoveUnnecessaryFStr

@pytest.mark.skip(
reason="May fail if it runs after the test_sql_parameterization. See Issue #378."
)
def test_no_change(self, tmpdir):
before = r"""
good: str = "good"
Expand All @@ -23,9 +18,6 @@ def test_no_change(self, tmpdir):
"""
self.run_and_assert(tmpdir, before, before)

@pytest.mark.skip(
reason="May fail if it runs after the test_sql_parameterization. See Issue #378."
)
def test_change(self, tmpdir):
before = r"""
bad: str = f"bad" + "bad"
Expand All @@ -39,9 +31,6 @@ def test_change(self, tmpdir):
"""
self.run_and_assert(tmpdir, before, after, num_changes=3)

@pytest.mark.skip(
reason="May fail if it runs after the test_sql_parameterization. See Issue #378."
)
def test_exclude_line(self, tmpdir):
input_code = (
expected
Expand Down

0 comments on commit d331017

Please sign in to comment.