nixos/test-driver: target python 3.12

This commit is contained in:
Nick Cao
2024-11-22 10:26:04 -05:00
parent 5b5f018586
commit 172a35f8ce
4 changed files with 32 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
import time
from collections.abc import Callable
from math import isfinite
from typing import Callable, Optional
from test_driver.logger import AbstractLogger
@@ -12,7 +12,7 @@ class PollingConditionError(Exception):
class PollingCondition:
condition: Callable[[], bool]
seconds_interval: float
description: Optional[str]
description: str | None
logger: AbstractLogger
last_called: float
@@ -20,10 +20,10 @@ class PollingCondition:
def __init__(
self,
condition: Callable[[], Optional[bool]],
condition: Callable[[], bool | None],
logger: AbstractLogger,
seconds_interval: float = 2.0,
description: Optional[str] = None,
description: str | None = None,
):
self.condition = condition # type: ignore
self.seconds_interval = seconds_interval