Skip to content

test: add unit tests for setup_logger - #1362

Open
Dor-bl wants to merge 1 commit into
appium:masterfrom
Dor-bl:mirror/test-setup-logger
Open

Dor-bl wants to merge 1 commit into
appium:masterfrom
Dor-bl:mirror/test-setup-logger

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds test/unit/common/logger_test.py covering setup_logger() with the default level and with logging.DEBUG: propagate is off, the level is set, and exactly one StreamHandler to sys.stderr is added.

setup_logger mutates the shared module logger (it adds a handler on every call), so an autouse fixture snapshots and restores the logger's handlers, level and propagate after each test, so the rest of the suite isn't affected.

  • make unittest: all pass
  • ruff check, ruff format --check: clean

@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Dor-bl / name: Dor Blayzer (a9980e2)

Cover the default and custom-level configurations of setup_logger. An
autouse fixture restores the shared module logger after each test, since
setup_logger adds a handler on every call.
@Dor-bl
Dor-bl force-pushed the mirror/test-setup-logger branch from c6b7a90 to a9980e2 Compare November 8, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant