Skip to content

testing.py lacks __all__ — internal _RunAppInvocation is implicitly accessible #106

Description

@codeforester

Problem

base_cli.testing is exported as a module in base_cli.__all__, making it a documented public interface. However, testing.py itself has no __all__ definition.

The module contains:

  • invoke() — public test helper, intended for consumer use
  • _RunAppInvocation — internal class (underscore prefix marks it private)

Without __all__, the internal _RunAppInvocation class is implicitly part of the module's public surface for any tool that enumerates module members (e.g., dir(base_cli.testing), pydoc, mkdocs auto-documentation). The underscore prefix suppresses from base_cli.testing import * correctly, but it does not prevent IDE discovery or documentation generation from showing the internal class.

Fix

Add to testing.py:

__all__ = ["invoke"]

This makes the intended public surface explicit and consistent with the rest of the package, where every module that is in base_cli.__all__ has its own __all__ (confirmed: history.py, command_protocol.py, command_filters.py, json_contracts.py, extensions.py, config.py, context.py, typer.py all have __all__).

Verification

After the fix, base_cli.testing.__all__ should equal ["invoke"]. The contract test in test_public_api.py should be updated to cover base_cli.testing.__all__ as well.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions