Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lite_bootstrap/bootstrappers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class BaseBootstrapper(abc.ABC, typing.Generic[ApplicationT]):
def __init__(self, bootstrap_config: BaseConfig) -> None:
self.is_bootstrapped = False
if not self.is_ready():
raise RuntimeError(self.not_ready_message)
msg = f"{type(self).__name__} is not ready because {self.not_ready_message}"
raise RuntimeError(msg)

self.bootstrap_config = bootstrap_config
self.instruments = []
Expand All @@ -38,7 +39,7 @@ def __init__(self, bootstrap_config: BaseConfig) -> None:
continue

if not instrument.is_ready():
logger.info(instrument.not_ready_message)
logger.info(f"{instrument_type.__name__} is not ready, because {instrument.not_ready_message}")
continue

self.instruments.append(instrument)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ignore = [
"D213", # "multi-line-summary-second-line" conflicting with D212
"COM812", # flake8-commas "Trailing comma missing"
"ISC001", # flake8-implicit-str-concat
"G004", # allow f-strings in logging
]
isort.lines-after-imports = 2
isort.no-lines-before = ["standard-library", "local-folder"]
Expand Down
4 changes: 3 additions & 1 deletion tests/test_free_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def test_free_bootstrap_logging_not_ready(log_output: list[EventDict]) -> None:
logging_buffer_capacity=0,
),
)
assert log_output == [{"event": "service_debug is True", "log_level": "info"}]
assert log_output == [
{"event": "LoggingInstrument is not ready, because service_debug is True", "log_level": "info"}
]


@pytest.mark.parametrize(
Expand Down
Loading