Skip to content

Commit

Permalink
Add regression test for #1667 (#7113)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls authored Jul 18, 2022
1 parent e625f2f commit ff3f91d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/whatsnew/fragments/1667.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix a failure to lint packages with ``__init__.py`` contained in directories lacking ``__init__.py``.

Closes #1667
9 changes: 9 additions & 0 deletions tests/lint/unittest_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,3 +933,12 @@ def test_import_sibling_module_from_namespace(initialized_linter: PyLinter) -> N
with fix_import_path([tmpdir]):
linter.check(["submodule2.py"])
assert not linter.stats.by_msg


def test_lint_namespace_package_under_dir(initialized_linter: PyLinter) -> None:
"""Regression test for https://github.com/PyCQA/pylint/issues/1667"""
linter = initialized_linter
with tempdir():
create_files(["outer/namespace/__init__.py", "outer/namespace/module.py"])
linter.check(["outer.namespace"])
assert not linter.stats.by_msg

0 comments on commit ff3f91d

Please sign in to comment.