Skip to content

Commit

Permalink
Add small test of basic logging config
Browse files Browse the repository at this point in the history
  • Loading branch information
noemifrisina committed Jun 19, 2023
1 parent ebd43cc commit 9876d89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
"python.testing.pytestArgs": [],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.formatting.provider": "black",
"python.formatting.provider": "none",
"python.languageServer": "Pylance",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
7 changes: 7 additions & 0 deletions tests/I24/serial/test_log.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from unittest.mock import patch

from mx_bluesky.I24.serial import log
Expand All @@ -8,3 +9,9 @@ def test_logging_file_path(mock_dir):
log_path = log._get_logging_file_path()
assert mock_dir.call_count == 1
assert log_path.as_posix() == "tmp/logs"


def test_basic_logging_config():
logger = logging.getLogger("I24ssx")
assert logger.hasHandlers() is True
assert len(logger.handlers) == 1

0 comments on commit 9876d89

Please sign in to comment.