Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test suite under Sphinx 7.4+ #1007

Merged
merged 5 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions breathe/file_state_cache.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pathlib import Path

from sphinx.application import Sphinx
Expand Down
2 changes: 2 additions & 0 deletions breathe/process.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pathlib import Path

from breathe.project import AutoProjectInfo, ProjectInfoFactory
Expand Down
9 changes: 5 additions & 4 deletions tests/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def app(test_params, app_params, make_app, shared_result):
args, kwargs = app_params
assert "srcdir" in kwargs
os.makedirs(kwargs["srcdir"], exist_ok=True)
(kwargs["srcdir"] / "conf.py").write_text("")
(kwargs["srcdir"] / "conf.py").write_text("", encoding="ascii")
app_ = make_app(*args, **kwargs)
yield app_

Expand Down Expand Up @@ -124,7 +124,7 @@ def __init__(self, app):
env.temp_data["docname"] = "mock-doc"
env.temp_data["breathe_project_info_factory"] = ProjectInfoFactory(app)
env.temp_data["breathe_parser_factory"] = DoxygenParserFactory(app)
settings = frontend.OptionParser(components=(parsers.rst.Parser,)).get_default_values()
settings = frontend.get_default_settings(parsers.rst.Parser)
settings.env = env
self.document = utils.new_document("", settings)

Expand Down Expand Up @@ -167,13 +167,14 @@ def mask(self, node):

class MockContext:
def __init__(self, app, node_stack, domain=None, options=[]):
from docutils.statemachine import StringList
self.domain = domain
self.node_stack = node_stack
self.directive_args = [
None, # name
None, # arguments
options, # options
None, # content
StringList([], items=[]), # content
None, # lineno
None, # content_offset
None, # block_text
Expand Down Expand Up @@ -546,7 +547,7 @@ def get_matches(datafile):
from xml.dom import minidom

argsstrings = []
with open(os.path.join(os.path.dirname(__file__), "data", datafile)) as fid:
with open(os.path.join(os.path.dirname(__file__), "data", datafile), encoding="utf-8") as fid:
xml = fid.read()
doc = minidom.parseString(xml)

Expand Down
Loading