nixos/test-driver: name exception according to pep8
see https://docs.astral.sh/ruff/rules/error-suffix-on-exception-name/
This commit is contained in:
@@ -5,7 +5,7 @@ from typing import Callable, Optional
|
|||||||
from .logger import rootlog
|
from .logger import rootlog
|
||||||
|
|
||||||
|
|
||||||
class PollingConditionFailed(Exception):
|
class PollingConditionError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class PollingCondition:
|
|||||||
|
|
||||||
def maybe_raise(self) -> None:
|
def maybe_raise(self) -> None:
|
||||||
if not self.check():
|
if not self.check():
|
||||||
raise PollingConditionFailed(self.status_message(False))
|
raise PollingConditionError(self.status_message(False))
|
||||||
|
|
||||||
def status_message(self, status: bool) -> str:
|
def status_message(self, status: bool) -> str:
|
||||||
return f"Polling condition {'succeeded' if status else 'failed'}: {self.description}"
|
return f"Polling condition {'succeeded' if status else 'failed'}: {self.description}"
|
||||||
|
|||||||
Reference in New Issue
Block a user