Skip to content

Commit 049b6c2

Browse files
Update tests/test_logs.py
Co-authored-by: Julian Stirling <julian@julianstirling.co.uk>
1 parent f461746 commit 049b6c2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/test_logs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ def test_cli_debug_flag_with_thing(caplog):
219219
{"things": {"my_thing": {"cls": "tests.test_logs.ThingWithDebugInit"}}}
220220
)
221221

222+
# Run without --debug and capture logs
223+
with caplog.at_level(logging.DEBUG, logger="labthings_fastapi.things"):
224+
serve_from_cli(["--json", config_json], dry_run=True)
225+
226+
# There are no logs
227+
assert len(caplog.messages) == 0
228+
222229
# Run with --debug and capture logs
223230
with caplog.at_level(logging.DEBUG, logger="labthings_fastapi.things"):
224231
serve_from_cli(["--json", config_json, "--debug"], dry_run=True)

0 commit comments

Comments
 (0)