Skip to content

Commit

Permalink
refac: migrate logging from logging logger to custom qa-docs logg…
Browse files Browse the repository at this point in the history
…er in `PytestWrap` module. #1879
  • Loading branch information
Luis Gonzalez committed Sep 15, 2021
1 parent d0ea391 commit d15979a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions deps/wazuh_testing/wazuh_testing/qa_docs/lib/pytest_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"""

import pytest
import logging

from wazuh_testing.qa_docs import QADOCS_LOGGER
from wazuh_testing.tools.logging import Logging
from wazuh_testing.tools.exceptions import QAValueError

class PytestPlugin:
"""
Expand All @@ -28,6 +31,8 @@ class PytestWrap:
"""
brief: Class that wraps the execution of pytest.
"""
LOGGER = Logging.get_logger(QADOCS_LOGGER)

def __init__(self):
self.plugin = PytestPlugin()

Expand All @@ -38,7 +43,7 @@ def collect_test_cases(self, path):
- "path (string): Path of the test file to extract the test cases.
returns: "dictionary: The output of pytest parsed into a dictionary"
"""
logging.debug(f"Running pytest to collect testcases for '{path}'")
PytestWrap.LOGGER.debug(f"Running pytest to collect testcases for '{path}'")
pytest.main(['--collect-only', "-qq", path], plugins=[self.plugin])
output = {}
for item in self.plugin.collected:
Expand Down

0 comments on commit d15979a

Please sign in to comment.