mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-04 01:21:03 +03:00
Lint new EDMCLogging test
This commit is contained in:
parent
4db6542269
commit
bf54af7211
@ -1,3 +1,4 @@
|
|||||||
|
"""Test that logging works correctly from a class-definition caller."""
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path += "../" # Dont ask me why for this one it breaks, it just does.
|
sys.path += "../" # Dont ask me why for this one it breaks, it just does.
|
||||||
@ -15,17 +16,17 @@ class ClassVarLogger:
|
|||||||
"""Test class with logger attached."""
|
"""Test class with logger attached."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def set_logger(cls, logger):
|
def set_logger(cls, logger) -> None:
|
||||||
"""Set the passed logger onto the _class_."""
|
"""Set the passed logger onto the _class_."""
|
||||||
ClassVarLogger.logger = logger
|
ClassVarLogger.logger = logger # type: ignore
|
||||||
|
|
||||||
|
|
||||||
def log_stuff(msg: str):
|
def log_stuff(msg: str) -> None:
|
||||||
"""Wrapper logger func."""
|
"""Wrap logging in another function."""
|
||||||
ClassVarLogger.logger.debug(msg) # type: ignore # its there
|
ClassVarLogger.logger.debug(msg) # type: ignore # its there
|
||||||
|
|
||||||
|
|
||||||
def test_class_logger(caplog: 'LogCaptureFixture'):
|
def test_class_logger(caplog: 'LogCaptureFixture') -> None:
|
||||||
"""
|
"""
|
||||||
Test that logging from a class variable doesn't explode.
|
Test that logging from a class variable doesn't explode.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user