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

Add events attribute to MockApp #452

Merged
merged 1 commit into from
Aug 28, 2019

Conversation

D4N
Copy link
Contributor

@D4N D4N commented Aug 28, 2019

When updating python-breathe for Fedora, I noticed that the test suite fails with errors like this:

======================================================================
ERROR: test_renderer.test_render_define_no_initializer
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/builddir/build/BUILD/breathe-4.13.1/tests/test_renderer.py", line 381, in test_render_define_no_initializer
    signature = find_node(render(member_def), 'desc_signature')
  File "/builddir/build/BUILD/breathe-4.13.1/tests/test_renderer.py", line 255, in render
    renderer.context = MockContext([member_def], domain)
  File "/builddir/build/BUILD/breathe-4.13.1/tests/test_renderer.py", line 137, in __init__
    MockState(), MockStateMachine()]
  File "/builddir/build/BUILD/breathe-4.13.1/tests/test_renderer.py", line 88, in __init__
    env = sphinx.environment.BuildEnvironment(MockApp())
  File "/usr/lib/python3.8/site-packages/sphinx/environment/__init__.py", line 192, in __init__
    self.setup(app)
  File "/usr/lib/python3.8/site-packages/sphinx/environment/__init__.py", line 218, in setup
    self.events = app.events
AttributeError: 'MockApp' object has no attribute 'events'

This appears to be caused by Fedora shipping Sphinx 2.1.2 now. Adding the events attribute to MockApp fixes this issue and the tests pass again.

This fixes test failures with Sphinx 2.1.2
@vermeeren vermeeren merged commit 6278e96 into breathe-doc:master Aug 28, 2019
@vermeeren
Copy link
Collaborator

Thanks for the patch.

vermeeren added a commit that referenced this pull request Aug 28, 2019
@D4N D4N deleted the sphinx_2_1_2_compat branch August 30, 2019 14:07
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