Skip to content

Commit 86741c8

Browse files
committed
fix(logging): Add NullHandler to sphinx_autodoc_pytest_fixtures
why: CLAUDE.md requires NullHandler in library __init__.py files to suppress spurious stderr output when no handler is configured. what: - Add logging import and NullHandler after all imports
1 parent 18d4c22 commit 86741c8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • packages/sphinx-autodoc-pytest-fixtures/src/sphinx_autodoc_pytest_fixtures

packages/sphinx-autodoc-pytest-fixtures/src/sphinx_autodoc_pytest_fixtures/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from __future__ import annotations
1515

16+
import logging
1617
import typing as t
1718

1819
from docutils import nodes
@@ -82,6 +83,8 @@
8283
if t.TYPE_CHECKING:
8384
from sphinx.application import Sphinx
8485

86+
logging.getLogger(__name__).addHandler(logging.NullHandler())
87+
8588

8689
def setup(app: Sphinx) -> SetupDict:
8790
"""Register the ``sphinx_autodoc_pytest_fixtures`` extension.

0 commit comments

Comments
 (0)