Skip to content

Conversation

rossbar
Copy link
Contributor

@rossbar rossbar commented Oct 17, 2024

The test suite has started failing with:

AttributeError: 'MockApp' object has no attribute '_exception_on_warning'

This started happening with the release of sphinx 8.1, and from a quick look at the changelog is likely related to sphinx-doc/sphinx#12743.

Since the failures are only related to the existence of attributes on a MockApp object used to simulate a sphinx-app instance in the numpydoc test suite, it should be okay to just patch the mocked object with the missing attr.

MockApp in test suite is now breaking due to the absence
of a private _exception_on_warning attribute.

Fix by explicitly adding to the MockApp.
@timhoffm
Copy link
Contributor

I believe this fix is the right and pragmatic approach. Sphinx is not designed with the possibility in mind that you replace the centrall components. Therefore, the inner APIs are a bit lax, which makes mocking difficult. As long as such a change is a rare event, updating the mock is the simplest way forward. If this happens more often, we'd need to go into the discussion with Sphinx how to handle the case.

@larsoner larsoner merged commit 1338660 into numpy:main Oct 17, 2024
26 checks passed
@larsoner
Copy link
Collaborator

Agreed @timhoffm , thanks for the quick fix @rossbar !

@stefanv stefanv added this to the 1.9.0 milestone Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants