From 856a49d596737dff8c0e1a5c3fb528c0b318c98b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:28:42 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- qgispluginci/__init__.py | 4 +++- qgispluginci/translation.py | 1 + test/__init__.py | 4 ++++ test/test_translation.py | 8 +++++--- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/qgispluginci/__init__.py b/qgispluginci/__init__.py index 50124b2d..1c957fdc 100644 --- a/qgispluginci/__init__.py +++ b/qgispluginci/__init__.py @@ -1,2 +1,4 @@ +import sys import logging -logging.basicConfig(level=logging.DEBUG) \ No newline at end of file + +logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) diff --git a/qgispluginci/translation.py b/qgispluginci/translation.py index 0713a0ac..dfe148fa 100644 --- a/qgispluginci/translation.py +++ b/qgispluginci/translation.py @@ -17,6 +17,7 @@ # GLOBALS logger = logging.getLogger(__name__) + class Translation: def __init__( self, parameters: Parameters, transifex_token: str, create_project: bool = True diff --git a/test/__init__.py b/test/__init__.py index e69de29b..9e7e9ad0 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -0,0 +1,4 @@ +import logging +import sys + +logging.basicConfig(stream=sys.stdout, level=logging.INFO) diff --git a/test/test_translation.py b/test/test_translation.py index 6d019332..23f1d0c2 100644 --- a/test/test_translation.py +++ b/test/test_translation.py @@ -16,6 +16,8 @@ # Tests from .utils import can_skip_test +# Logging +logger = logging.getLogger(__name__) class TestTranslation(unittest.TestCase): @classmethod @@ -28,19 +30,19 @@ def setUpClass(cls): assert cls.transifex_token def setUp(self): - """Initialize the next test method (run between every test method)""" + """Initialize the next test method (run before every test method)""" self.t = Translation(self.parameters, transifex_token=self.transifex_token) def tearDown(self): try: self.t._t.delete_project(self.parameters.project_slug) except PyTransifexException as error: - logging.debug(error) + logger.debug(error) """ try: self.t._t.delete_team(f"{self.parameters.project_slug}-team") except PyTransifexException as error: - logging.debug(error) + logger.debug(error) """ @unittest.skipIf(can_skip_test(), "Missing transifex_token")