Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhihao-723 committed Nov 11, 2023
1 parent 8beaa59 commit 6581eac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description = "Logging/encoding/decoding using CLP's IR stream format"
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"clp-ffi-py >= 0.0.1",
"clp-ffi-py >= 0.0.7",
"python-dateutil >= 2.7.0",
"typing-extensions >= 3.7.4",
"zstandard >= 0.18.0",
Expand All @@ -24,7 +24,7 @@ classifiers = [

[project.optional-dependencies]
dev = [
"black >= 22.10.0",
"black >= 23.11.0",
"build >= 0.8.0",
"docformatter >= 1.5.1",
"mypy >= 0.982",
Expand Down
40 changes: 19 additions & 21 deletions tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,25 +237,25 @@ def test_time_format_at_start(self) -> None:
self.clp_handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(message)s"))
self.raw_handler.setFormatter(logging.Formatter(" [%(levelname)s] %(message)s"))
self.logger.info("format starts with %(asctime)s")
self.assert_clp_logs(
[f"{WARN_PREFIX.lstrip()} replacing '%(asctime)s' with clp_logging timestamp format"]
)
self.assert_clp_logs([
f"{WARN_PREFIX.lstrip()} replacing '%(asctime)s' with clp_logging timestamp format"
])

def test_time_format_in_middle(self) -> None:
fmt: str = "[%(levelname)s] %(asctime)s %(message)s"
self.clp_handler.setFormatter(logging.Formatter(fmt))
self.logger.info("format has %(asctime)s in the middle")
self.assert_clp_logs(
[f"{WARN_PREFIX.lstrip()} replacing '{fmt}' with '{DEFAULT_LOG_FORMAT}'"]
)
self.assert_clp_logs([
f"{WARN_PREFIX.lstrip()} replacing '{fmt}' with '{DEFAULT_LOG_FORMAT}'"
])

def test_time_format_missing(self) -> None:
self.clp_handler.setFormatter(logging.Formatter("[%(levelname)s] %(message)s"))
self.raw_handler.setFormatter(logging.Formatter(" [%(levelname)s] %(message)s"))
self.logger.info("no asctime in format")
self.assert_clp_logs(
[f"{WARN_PREFIX.lstrip()} prepending clp_logging timestamp to formatter"]
)
self.assert_clp_logs([
f"{WARN_PREFIX.lstrip()} prepending clp_logging timestamp to formatter"
])

def test_static(self) -> None:
self.logger.info("static text log one")
Expand Down Expand Up @@ -322,18 +322,16 @@ def test_bad_timeout_dicts(self) -> None:
self._setup_handler()

self.logger.debug("debug log0")
self.assert_clp_logs(
[
(
f"{WARN_PREFIX.lstrip()} log level {logging.DEBUG} not in"
" self.hard_timeout_deltas; defaulting to _HARD_TIMEOUT_DELTAS[logging.INFO]."
),
(
f"{WARN_PREFIX.lstrip()} log level {logging.DEBUG} not in"
" self.soft_timeout_deltas; defaulting to _SOFT_TIMEOUT_DELTAS[logging.INFO]."
),
]
)
self.assert_clp_logs([
(
f"{WARN_PREFIX.lstrip()} log level {logging.DEBUG} not in"
" self.hard_timeout_deltas; defaulting to _HARD_TIMEOUT_DELTAS[logging.INFO]."
),
(
f"{WARN_PREFIX.lstrip()} log level {logging.DEBUG} not in"
" self.soft_timeout_deltas; defaulting to _SOFT_TIMEOUT_DELTAS[logging.INFO]."
),
])

def _test_timeout(
self,
Expand Down

0 comments on commit 6581eac

Please sign in to comment.