diff options
Diffstat (limited to 'tests/extensions')
-rw-r--r-- | tests/extensions/test_private_import.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/extensions/test_private_import.py b/tests/extensions/test_private_import.py index d2d79947f..c82f51a42 100644 --- a/tests/extensions/test_private_import.py +++ b/tests/extensions/test_private_import.py @@ -4,7 +4,7 @@ """Tests the local module directory comparison logic which requires mocking file directories""" -from unittest.mock import patch +from unittest.mock import MagicMock, patch import astroid @@ -19,7 +19,7 @@ class TestPrivateImport(CheckerTestCase): CHECKER_CLASS = private_import.PrivateImportChecker @patch("pathlib.Path.parent") - def test_internal_module(self, parent) -> None: + def test_internal_module(self, parent: MagicMock) -> None: parent.parts = ("", "dir", "module") import_from = astroid.extract_node("""from module import _file""") @@ -27,7 +27,7 @@ class TestPrivateImport(CheckerTestCase): self.checker.visit_importfrom(import_from) @patch("pathlib.Path.parent") - def test_external_module_nested(self, parent) -> None: + def test_external_module_nested(self, parent: MagicMock) -> None: parent.parts = ("", "dir", "module", "module_files", "util") import_from = astroid.extract_node("""from module import _file""") @@ -36,7 +36,7 @@ class TestPrivateImport(CheckerTestCase): self.checker.visit_importfrom(import_from) @patch("pathlib.Path.parent") - def test_external_module_dot_import(self, parent) -> None: + def test_external_module_dot_import(self, parent: MagicMock) -> None: parent.parts = ("", "dir", "outer", "inner", "module_files", "util") import_from = astroid.extract_node("""from outer.inner import _file""") @@ -45,7 +45,7 @@ class TestPrivateImport(CheckerTestCase): self.checker.visit_importfrom(import_from) @patch("pathlib.Path.parent") - def test_external_module_dot_import_outer_only(self, parent) -> None: + def test_external_module_dot_import_outer_only(self, parent: MagicMock) -> None: parent.parts = ("", "dir", "outer", "extensions") import_from = astroid.extract_node("""from outer.inner import _file""") @@ -54,7 +54,7 @@ class TestPrivateImport(CheckerTestCase): self.checker.visit_importfrom(import_from) @patch("pathlib.Path.parent") - def test_external_module(self, parent) -> None: + def test_external_module(self, parent: MagicMock) -> None: parent.parts = ("", "dir", "other") import_from = astroid.extract_node("""from module import _file""") |