-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Don't consider imported objects as public
Discussion-169: mkdocstrings/python#169
- Loading branch information
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""Tests for public API handling.""" | ||
|
||
from griffe.tests import temporary_visited_module | ||
|
||
|
||
def test_not_detecting_imported_objects_as_public() -> None: | ||
"""Imported objects not listed in `__all__` must not be considered public.""" | ||
with temporary_visited_module("from abc import ABC\ndef func(): ...") as module: | ||
assert not module["ABC"].is_public | ||
assert module["func"].is_public # control case |