Skip to content

Commit

Permalink
squash: fixing tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
happz committed Jan 5, 2024
1 parent 6982430 commit b6a3250
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
20 changes: 10 additions & 10 deletions tmt/queue.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataclasses
from collections.abc import Iterator
from concurrent.futures import Future, ThreadPoolExecutor, as_completed
from typing import TYPE_CHECKING, Generic, Optional, TypeVar
from typing import TYPE_CHECKING, Any, Generic, Optional, TypeVar

import tmt.utils
from tmt.log import Logger
Expand Down Expand Up @@ -52,13 +52,13 @@ class Task(Generic[TaskResultT]):
requested_exit: Optional[SystemExit]

# Custom yet trivial `__init__` is necessary, see note in `tmt.queue.Task`.
def __init__(self, logger: Logger) -> None:
def __init__(self, logger: Logger, **kwargs: Any) -> None:
self.logger = logger

self.result = None
self.guest = None
self.exc = None
self.requested_exit = None
self.result = kwargs.get('result', None)
self.guest = kwargs.get('guest', None)
self.exc = kwargs.get('exc', None)
self.requested_exit = kwargs.get('requested_exit', None)

@property
def name(self) -> str:
Expand Down Expand Up @@ -131,8 +131,8 @@ class GuestlessTask(Task[TaskResultT]):
"""

# Custom yet trivial `__init__` is necessary, see note in `tmt.queue.Task`.
def __init__(self, logger: Logger) -> None:
super().__init__(logger)
def __init__(self, logger: Logger, **kwargs: Any) -> None:
super().__init__(logger, **kwargs)

def run(self, logger: Logger) -> TaskResultT:
"""
Expand Down Expand Up @@ -188,8 +188,8 @@ class MultiGuestTask(Task[TaskResultT]):
guests: list['Guest']

# Custom yet trivial `__init__` is necessary, see note in `tmt.queue.Task`.
def __init__(self, logger: Logger, guests: list['Guest']) -> None:
super().__init__(logger)
def __init__(self, logger: Logger, guests: list['Guest'], **kwargs: Any) -> None:
super().__init__(logger, **kwargs)

self.guests = guests

Expand Down
20 changes: 12 additions & 8 deletions tmt/steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1962,8 +1962,9 @@ class ActionTask(tmt.queue.GuestlessTask[None]):
def __init__(
self,
logger: tmt.log.Logger,
phase: Action) -> None:
super().__init__(logger)
phase: Action,
**kwargs: Any) -> None:
super().__init__(logger, **kwargs)

self.phase = phase

Expand All @@ -1986,8 +1987,9 @@ def __init__(
self,
logger: tmt.log.Logger,
guests: list['Guest'],
phase: Plugin[StepDataT]) -> None:
super().__init__(logger, guests)
phase: Plugin[StepDataT],
**kwargs: Any) -> None:
super().__init__(logger, guests, **kwargs)

self.phase = phase

Expand Down Expand Up @@ -2048,8 +2050,9 @@ class PushTask(tmt.queue.MultiGuestTask[None]):
def __init__(
self,
logger: tmt.log.Logger,
guests: list['Guest']) -> None:
super().__init__(logger, guests)
guests: list['Guest'],
**kwargs: Any) -> None:
super().__init__(logger, guests, **kwargs)

@property
def name(self) -> str:
Expand All @@ -2070,8 +2073,9 @@ def __init__(
self,
logger: tmt.log.Logger,
guests: list['Guest'],
source: Optional[Path] = None) -> None:
super().__init__(logger, guests)
source: Optional[Path] = None,
**kwargs: Any) -> None:
super().__init__(logger, guests, **kwargs)

self.source = source

Expand Down

0 comments on commit b6a3250

Please sign in to comment.