Commit 87903804 authored by Federico Falconieri's avatar Federico Falconieri
Browse files

Merge branch 'hoverht-master-patch-91302' into 'master'

feat: show logging output during test

See merge request ci/templates!114
parents a98fb67f c5ac28fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ python:pytest:
    PYTEST_COVERAGE_THRESHOLD: "25"
    INSTALL_PYTEST_PLUGINS: "pytest-asyncio pytest-xdist"  # See https://docs.pytest.org/en/latest/reference/plugin_list.html
    CHECK_PATH: "./${PYTHON_PACKAGE}"
    DEFAULT_ARGS: "-vvv --capture=tee-sys"
    DEFAULT_ARGS: "-vvv --capture=tee-sys -o log_cli=true -o log_cli_level=DEBUG --color=yes"
    EXTRA_ARGS: ""  # Set optional arguments
  script:
    - pip install pytest pytest-cov ${INSTALL_PYTEST_PLUGINS}
+9 −0
Original line number Diff line number Diff line
@@ -2,9 +2,18 @@
I can even make docstrings here! I'm awesome.
"""

import logging

from mypackage import mymodule

logger = logging.getLogger(__name__)


def test_myfunction():
    """Testing always makes me joyful."""
    logger.debug("We're in the function now, amazing! This is a debug message.")
    logger.info("You should know about this INFOrmational message!")
    logger.warning("Be warned, things may get hairy now.")
    logger.error("Ah, an error, we screwed up.")
    logger.critical("Lord o lord, it's critical. But we must move on.")
    assert mymodule.myfunction(variable=3) == 11