Skip to content

Test log: info and warning never show up #22335

Closed as not planned
Closed as not planned
@aeschli

Description

@aeschli

Testing #22291

class TestLogger(unittest.TestCase):
    def test_logging(self):
        logger = logging.getLogger(__name__)
        #logger.setLevel(logging.DEBUG)  # Set the desired log level
        logger.setLevel(logging.INFO)  # Set the desired log level

        logger.debug("This is a debug message in a unittest.")
        logger.info("This is an info message in a unittest.")
        logger.warning("This is a warning message in a unittest.")
        logger.error("This is an error message in a unittest.")
        logger.critical("This is a critical message in a unittest.")

        # Printing to stdout and stderr
        print("This is a stdout message.")
        print("This is a stderr message.", file=sys.stderr)

Regardless of log level, logger.debug and logger.info never show up in the Python test log. Is that expected?

Metadata

Metadata

Assignees

Labels

area-testinginfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions