MCPcopy Create free account
hub / github.com/pytest-dev/pytest / filter

Method filter

doc/en/conf.py:407–416  ·  view source on GitHub ↗

Ignore warnings about missing include with "only" directive. Ref: https://github.com/sphinx-doc/sphinx/issues/2150.

(self, record: logging.LogRecord)

Source from the content-addressed store, hash-verified

405
406 class WarnLogFilter(logging.Filter):
407 def filter(self, record: logging.LogRecord) -> bool:
408 """Ignore warnings about missing include with "only" directive.
409
410 Ref: https://github.com/sphinx-doc/sphinx/issues/2150."""
411 if (
412 record.msg.startswith('Problems with "include" directive path:')
413 and "_changelog_towncrier_draft.rst" in record.msg
414 ):
415 return False
416 return True
417
418 logger = logging.getLogger(sphinx.util.logging.NAMESPACE)
419 warn_handler = [x for x in logger.handlers if x.level == logging.WARNING]

Calls

no outgoing calls