Skip to content

Commit

Permalink
feat: Accept inits parameter in temporary_visited_package
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 13, 2024
1 parent 05c3ad3 commit a4859b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/_griffe/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def temporary_visited_package(
modules: Sequence[str] | Mapping[str, str] | None = None,
*,
init: bool = True,
inits: bool = True,
extensions: Extensions | None = None,
docstring_parser: Parser | None = None,
docstring_options: dict[str, Any] | None = None,
Expand All @@ -139,7 +140,8 @@ def temporary_visited_package(
If a list, simply touch the files: `["b.py", "c/d.py", "e/f"]`.
If a dict, keys are the file names and values their contents:
`{"b.py": "b = 1", "c/d.py": "print('hey from c')"}`.
init: Whether to create an `__init__` module in the leaf package.
init: Whether to create an `__init__` module in the top package.
inits: Whether to create `__init__` modules in subpackages.
extensions: The extensions to use.
docstring_parser: The docstring parser to use. By default, no parsing is done.
docstring_options: Additional docstring parsing options.
Expand All @@ -151,7 +153,7 @@ def temporary_visited_package(
Yields:
A module.
"""
with temporary_pypackage(package, modules, init=init) as tmp_package:
with temporary_pypackage(package, modules, init=init, inits=inits) as tmp_package:
loader = GriffeLoader(
search_paths=[tmp_package.tmpdir],
extensions=extensions,
Expand Down

0 comments on commit a4859b7

Please # to comment.