fix: add missing type annotations and remove unused variables in new tests
Pyright flagged three inner class `status` methods missing a type annotation on the `quiet` parameter, and two unused variables (`written`, `real_status`) left over from an earlier draft of test_docker_quiet_true_suppresses_stderr. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -409,7 +409,7 @@ class TestIsBackendReady(unittest.TestCase):
|
|||||||
|
|
||||||
def test_ready_when_status_returns_zero(self):
|
def test_ready_when_status_returns_zero(self):
|
||||||
class _ReadyBackend:
|
class _ReadyBackend:
|
||||||
def status(self, *, quiet=False):
|
def status(self, *, quiet: bool = False) -> int:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
from bot_bottle.backend import is_backend_ready
|
from bot_bottle.backend import is_backend_ready
|
||||||
@@ -418,7 +418,7 @@ class TestIsBackendReady(unittest.TestCase):
|
|||||||
|
|
||||||
def test_not_ready_when_status_nonzero(self):
|
def test_not_ready_when_status_nonzero(self):
|
||||||
class _BrokenBackend:
|
class _BrokenBackend:
|
||||||
def status(self, *, quiet=False):
|
def status(self, *, quiet: bool = False) -> int:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
from bot_bottle.backend import is_backend_ready
|
from bot_bottle.backend import is_backend_ready
|
||||||
@@ -429,7 +429,7 @@ class TestIsBackendReady(unittest.TestCase):
|
|||||||
calls = []
|
calls = []
|
||||||
|
|
||||||
class _SpyBackend:
|
class _SpyBackend:
|
||||||
def status(self, *, quiet=False):
|
def status(self, *, quiet: bool = False) -> int:
|
||||||
calls.append(quiet)
|
calls.append(quiet)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -342,8 +342,6 @@ class TestBackendStatusQuiet(unittest.TestCase):
|
|||||||
def test_docker_quiet_true_suppresses_stderr(self):
|
def test_docker_quiet_true_suppresses_stderr(self):
|
||||||
import io as _io
|
import io as _io
|
||||||
from bot_bottle.backend.docker.backend import DockerBottleBackend
|
from bot_bottle.backend.docker.backend import DockerBottleBackend
|
||||||
written = []
|
|
||||||
real_status = dk.status
|
|
||||||
|
|
||||||
def _loud_status():
|
def _loud_status():
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
Reference in New Issue
Block a user