Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Completed: Convert normalize_doctree_xml to pytest fixture

Summary

Successfully converted normalize_doctree_xml from a standalone function to a pytest fixture. Tests no longer need to import it - they can now use it directly as a fixture parameter.

Changes Made

  • Converted normalize_doctree_xml to a pytest fixture in tests/conftest.py
    • Added @pytest.fixture decorator
    • Wrapped implementation in a callable that returns the normalize function
    • Maintains the same functionality and signature
  • Removed all imports of normalize_doctree_xml across test files (9 files)
  • Updated all test functions to accept normalize_doctree_xml as a fixture parameter
    • 8 test files updated
    • Multiple test functions per file updated
  • Applied ruff formatting to fix pre-commit issues
    • Properly formatted long function signatures across multiple lines
  • All tests passing successfully

Files Modified

  1. tests/conftest.py - Converted function to fixture, applied formatting
  2. tests/test_sphinx/conftest.py - Removed import, added fixture parameter to get_sphinx_app_doctree
  3. tests/test_html/test_html_to_nodes.py - Removed import, added fixture parameter
  4. tests/test_renderers/test_fixtures_docutils.py - Removed import, added fixture parameter to 5 test functions, applied formatting
  5. tests/test_renderers/test_myst_refs.py - Removed import, added fixture parameter
  6. tests/test_renderers/test_myst_config.py - Removed import, added fixture parameter
  7. tests/test_renderers/test_include_directive.py - Removed import, added fixture parameter
  8. tests/test_renderers/test_fixtures_sphinx.py - Removed import, added fixture parameter to 11 test functions, applied formatting
  9. tests/test_sphinx/test_sphinx_builds.py - Removed import, added fixture parameter

Testing

  • ✅ All pre-commit hooks passing (ruff-check, ruff-format, mypy, etc.)
  • ✅ All tests passing
  • ✅ No imports of normalize_doctree_xml remain in test files
Original prompt

make normalize_doctree_xml a pytest fixture, rather than having to import it


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 19, 2026 12:04
Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Copilot AI changed the title [WIP] Make normalize_doctree_xml a pytest fixture Convert normalize_doctree_xml to pytest fixture Jan 19, 2026
Copilot AI requested a review from chrisjsewell January 19, 2026 12:09
Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix pre-commit

@chrisjsewell chrisjsewell changed the title Convert normalize_doctree_xml to pytest fixture 🧪 Convert normalize_doctree_xml to pytest fixture Jan 19, 2026
@chrisjsewell chrisjsewell marked this pull request as ready for review January 19, 2026 12:12
Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 19, 2026

fix pre-commit

Fixed in dab28f2. Applied ruff formatting to function signatures that exceeded line length limits.

@chrisjsewell chrisjsewell merged commit f7ae219 into master Jan 19, 2026
22 checks passed
@chrisjsewell chrisjsewell deleted the copilot/make-normalize-doctree-xml-fixture branch January 19, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants