tests: reset root logger level in test teardown

This commit is contained in:
Alexis Murzeau 2024-03-13 00:43:23 +01:00 committed by GitHub
parent 6bbbb8e40b
commit 251fe08f8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -33,10 +33,13 @@ def _setup(monkeypatch: pytest.MonkeyPatch, session: Streamlink):
monkeypatch.setattr("streamlink_cli.main.setup_signals", Mock())
monkeypatch.setattr("streamlink_cli.argparser.find_default_player", Mock())
level = streamlink_cli.main.logger.root.level
try:
yield
finally:
streamlink_cli.main.logger.root.handlers.clear()
streamlink_cli.main.logger.root.setLevel(level)
streamlink_cli.main.args = None # type: ignore[assignment]
streamlink_cli.main.console = None # type: ignore[assignment]