Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobandersen committed Jan 22, 2022
1 parent e64bdf1 commit 8b136c0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ def __init__(self, **kwargs):

class MockState:
def __init__(self, app):
from breathe.project import ProjectInfoFactory
from breathe.parser import DoxygenParserFactory

env = sphinx.environment.BuildEnvironment(app)
env.setup(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.env = env
self.document = utils.new_document("", settings)
Expand Down Expand Up @@ -516,19 +521,13 @@ def test_render_innergroup(app):

def get_directive(app):
from breathe.directives.function import DoxygenFunctionDirective
from breathe.project import ProjectInfoFactory
from breathe.parser import DoxygenParserFactory
from breathe.finder.factory import FinderFactory
from docutils.statemachine import StringList

app.config.breathe_separate_member_pages = False
app.config.breathe_default_project = "test_project"
app.config.breathe_domain_by_extension = {}
app.config.breathe_domain_by_file_pattern = {}
app.config.breathe_use_project_refids = False
project_info_factory = ProjectInfoFactory(app)
parser_factory = DoxygenParserFactory(app)
finder_factory = FinderFactory(app, parser_factory)
cls_args = (
"doxygenclass",
["at::Tensor"],
Expand All @@ -543,7 +542,7 @@ def get_directive(app):
MockState(app),
MockStateMachine(),
)
return DoxygenFunctionDirective(finder_factory, project_info_factory, parser_factory, *cls_args)
return DoxygenFunctionDirective(*cls_args)


def get_matches(datafile):
Expand Down

0 comments on commit 8b136c0

Please sign in to comment.