-
-
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 trigger alias resolution while checking docstrings presence
- Loading branch information
Showing
3 changed files
with
22 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,14 @@ | ||
"""Tests for the `loader` module.""" | ||
|
||
from griffe.loader import GriffeLoader | ||
from tests.helpers import temporary_pyfile | ||
|
||
|
||
def test_has_docstrings_does_not_try_to_resolve_alias(): | ||
"""Assert that checkins presence of docstrings does not trigger alias resolution.""" | ||
with temporary_pyfile("""from abc import abstractmethod""") as (module_name, path): | ||
loader = GriffeLoader(search_paths=[path.parent]) | ||
module = loader.load_module(module_name) | ||
loader.resolve_aliases() | ||
assert "abstractmethod" in module.members | ||
assert not module.has_docstrings |