Skip to content

Commit

Permalink
Remove explicit self types (#4300)
Browse files Browse the repository at this point in the history
A few remain, but they are all orphaned instance methods, either mocks
or in one case a property wrapper, where the type of self is not
implicit.
  • Loading branch information
Qalthos authored Oct 19, 2024
1 parent 1c81268 commit bedaab6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/molecule/command/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init_subclass__(cls) -> None:

@abc.abstractmethod
def execute(
self: Base,
self,
action_args: list[str] | None = None,
) -> None: # pragma: no cover
"""Abstract method to execute the command.
Expand Down
4 changes: 2 additions & 2 deletions src/molecule/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ def __init__(self, config) -> None: # type: ignore[no-untyped-def] # noqa: ANN
self.config = config
self._setup() # type: ignore[no-untyped-call]

def _remove_scenario_state_directory(self: Scenario) -> None:
def _remove_scenario_state_directory(self) -> None:
"""Remove scenario cached disk stored state."""
directory = str(Path(self.ephemeral_directory).parent)
LOG.info("Removing %s", directory)
shutil.rmtree(directory)

def prune(self: Scenario) -> None:
def prune(self) -> None:
"""Prune the scenario ephemeral directory files and returns None.
"safe files" will not be pruned, including the ansible configuration
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
class ExtendedBase(base.Base):
"""ExtendedBase Class."""

def execute(self: ExtendedBase, action_args: list[str] | None = None) -> None:
def execute(self, action_args: list[str] | None = None) -> None:
"""No-op the execute method.
Args:
Expand Down

0 comments on commit bedaab6

Please sign in to comment.