Skip to content

Commit

Permalink
satisfying pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Chsudeepta authored and Chsudeepta committed Oct 17, 2024
1 parent 1da8554 commit 47a1c86
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/logger/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys

from ibex_bluesky_core.logger import logger
from logging.handlers import TimedRotatingFileHandler

LOG_MESSAGE = "Logging something to "

Check failure on line 7 in tests/logger/test_logger.py

View workflow job for this annotation

GitHub Actions / call-linter-workflow / ruff

Ruff (I001)

tests/logger/test_logger.py:1:1: I001 Import block is un-sorted or un-formatted
LOG_FILE_NAME = "blueskylogs.log"
Expand All @@ -15,14 +16,11 @@ def test_GIVEN_logging_is_requested_THEN_handler_is_added():

loghandler = None
for handler in logger.blueskylogger.handlers:
if isinstance(handler, logging.handlers.TimedRotatingFileHandler):
if isinstance(handler, TimedRotatingFileHandler):
loghandler = handler

assert isinstance(loghandler, logging.handlers.TimedRotatingFileHandler)
if isinstance(loghandler, logging.FileHandler):
assert loghandler is not None
assert loghandler.name == "timedRotatingFileHandler"
assert loghandler.baseFilename.endswith(LOG_FILE_NAME)

if isinstance(loghandler, logging.handlers.BaseRotatingHandler):
assert loghandler.when.lower() == "midnight"
assert isinstance(loghandler, TimedRotatingFileHandler)
assert loghandler is not None
assert loghandler.name == "timedRotatingFileHandler"
assert loghandler.baseFilename.endswith(LOG_FILE_NAME)
assert loghandler is not None

0 comments on commit 47a1c86

Please sign in to comment.