Skip to content

Commit

Permalink
Added test with __init__.py file for RemoveUnusedImports
Browse files Browse the repository at this point in the history
  • Loading branch information
andrecsilva committed Oct 26, 2023
1 parent cd6a305 commit 39edc0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/codemods/test_remove_unused_imports.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from core_codemods.remove_unused_imports import RemoveUnusedImports
from tests.codemods.base_codemod_test import BaseCodemodTest
from textwrap import dedent
Expand Down Expand Up @@ -113,3 +114,9 @@ def test_dont_remove_if_pylint_disable_next(self, tmpdir):
)
self.run_and_assert(tmpdir, before, before)
assert len(self.file_context.codemod_changes) == 0

def test_ignore_init_files(self, tmpdir):
before = "import a"
tmp_file_path = Path(tmpdir / "__init__.py")
self.run_and_assert_filepath(tmpdir, tmp_file_path, before, before)
assert len(self.file_context.codemod_changes) == 0

0 comments on commit 39edc0f

Please sign in to comment.