Force using keyword-only arguments where types are the same (#2277)

* Force using keyword-only arguments where types are the same

* Fix
This commit is contained in:
Ayaz Salikhov
2025-04-03 21:27:24 +01:00
committed by GitHub
parent fcff9a93bb
commit 1473c9bbda
8 changed files with 29 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
from typing import Any
from typing import Any, LiteralString
import docker
from docker.models.containers import Container
@@ -85,6 +85,7 @@ class TrackedContainer:
def run_and_wait(
self,
timeout: int,
*,
no_warnings: bool = True,
no_errors: bool = True,
no_failure: bool = True,
@@ -123,7 +124,7 @@ class TrackedContainer:
return TrackedContainer._lines_starting_with(logs, "WARNING")
@staticmethod
def _lines_starting_with(logs: str, pattern: str) -> list[str]:
def _lines_starting_with(logs: str, pattern: LiteralString) -> list[str]:
return [line for line in logs.splitlines() if line.startswith(pattern)]
def remove(self) -> None: