Loading behave_utils/docker.py +4 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ from subprocess import Popen from subprocess import run from types import TracebackType from typing import IO from typing import TYPE_CHECKING from typing import Any from typing import Iterable from typing import Iterator Loading Loading @@ -235,6 +236,7 @@ class Container(Item): exiting the context. """ if TYPE_CHECKING: T = TypeVar('T', bound='Container') DEFAULT_ALIASES = tuple[str]() Loading Loading @@ -276,7 +278,7 @@ class Container(Item): self.stop(rm=True) @contextmanager def started(self) -> Iterator[Container]: def started(self: T) -> Iterator[T]: """ Return a context manager that ensures the container is started when the context is entered """ Loading behave_utils/mysql.py +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ from time import sleep from typing import TYPE_CHECKING from typing import Iterator from typing import Sequence from typing import TypeVar from behave import fixture Loading @@ -39,6 +40,9 @@ class Mysql(Container): Container subclass for a database container """ if TYPE_CHECKING: T = TypeVar('T', bound='Mysql') def __init__( self, version: str = "latest", Loading Loading @@ -95,7 +99,7 @@ class Mysql(Container): return Cli(self, "mysqldump") @contextmanager def started(self) -> Iterator[Container]: def started(self: T) -> Iterator[T]: """ Return a context manager that only enters once the database is initialised """ Loading Loading
behave_utils/docker.py +4 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ from subprocess import Popen from subprocess import run from types import TracebackType from typing import IO from typing import TYPE_CHECKING from typing import Any from typing import Iterable from typing import Iterator Loading Loading @@ -235,6 +236,7 @@ class Container(Item): exiting the context. """ if TYPE_CHECKING: T = TypeVar('T', bound='Container') DEFAULT_ALIASES = tuple[str]() Loading Loading @@ -276,7 +278,7 @@ class Container(Item): self.stop(rm=True) @contextmanager def started(self) -> Iterator[Container]: def started(self: T) -> Iterator[T]: """ Return a context manager that ensures the container is started when the context is entered """ Loading
behave_utils/mysql.py +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ from time import sleep from typing import TYPE_CHECKING from typing import Iterator from typing import Sequence from typing import TypeVar from behave import fixture Loading @@ -39,6 +40,9 @@ class Mysql(Container): Container subclass for a database container """ if TYPE_CHECKING: T = TypeVar('T', bound='Mysql') def __init__( self, version: str = "latest", Loading Loading @@ -95,7 +99,7 @@ class Mysql(Container): return Cli(self, "mysqldump") @contextmanager def started(self) -> Iterator[Container]: def started(self: T) -> Iterator[T]: """ Return a context manager that only enters once the database is initialised """ Loading