fix tests based on API change in Sphinx

Upstream Sphinx now has some new expectations that are no longer being
met by some of our tests because we mock the constructor for the
application class. Fix the test to ensure the application instance has
the needed attributes.

Change-Id: Iad009ce74301c9ffd49ff2b2bab4afd9b7dd1388
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-06-13 16:52:05 -04:00
parent f62ebcb4b2
commit d3b2b79f23
1 changed files with 8 additions and 0 deletions

View File

@ -233,6 +233,14 @@ class BaseSphinxTest(base.BaseTestCase):
def setUp(self):
super(BaseSphinxTest, self).setUp()
# setup_command requires the Sphinx instance to have some
# attributes that aren't set normally with the way we use the
# class (because we replace the constructor). Add default
# values directly to the class definition.
import sphinx.application
sphinx.application.Sphinx.messagelog = []
sphinx.application.Sphinx.statuscode = 0
self.useFixture(fixtures.MonkeyPatch(
"sphinx.application.Sphinx.__init__", lambda *a, **kw: None))
self.useFixture(fixtures.MonkeyPatch(