Skip to content

Commit

Permalink
tests: Clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 23, 2024
1 parent 551b6e7 commit 86cda59
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions tests/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,24 +489,3 @@ def test_not_calling_package_loaded_hook_on_something_else_than_package() -> Non
alias: Alias = loader.load("pkg.L") # type: ignore[assignment]
assert alias.is_alias
assert not alias.resolved


@pytest.mark.parametrize("dynamic", [True, False])
def test_warning_on_objects_from_non_submodules_being_exported(
caplog: pytest.LogCaptureFixture,
dynamic: bool,
) -> None:
"""Warn when objects from non-submodules are exported."""
temporary_package = temporary_inspected_package if dynamic else temporary_visited_package
with caplog.at_level(logging.DEBUG, logger="griffe"), temporary_package(
"pkg",
{
"__init__.py": "from typing import List\nfrom pkg import moda, modb\n__all__ = ['List']",
"moda.py": "class Thing: ...",
"modb.py": "from pkg.moda import Thing\n\n__all__ = ['Thing']",
},
resolve_aliases=True,
):
messages = [record.message for record in caplog.records]
assert any("Name `List` exported by module" in msg for msg in messages)
assert any("Name `Thing` exported by module" in msg for msg in messages)

0 comments on commit 86cda59

Please sign in to comment.