Skip to content

Commit

Permalink
Test that logging actually writes to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
dbast committed Jul 6, 2024
1 parent 94dc795 commit a1d3489
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ branch = true

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-p no:logging"

[tool.setuptools]
include-package-data = true
Expand Down
7 changes: 7 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ def test_main__argparse__enable_debug_logging(patched_controller, patched_loggin
def test_main__argparse__invalid_arg():
with pytest.raises(SystemExit):
main(["--invalid"])


@patch("seedsigner.main.Controller")
def test_main__logging__writes_to_stderr(patched_controller, capsys):
main([])
out, err = capsys.readouterr()
assert "INFO: Starting Seedsigner with: {'loglevel': 'INFO'}" in err

0 comments on commit a1d3489

Please sign in to comment.