diff options
author | Doug Hellmann <doug@doughellmann.com> | 2017-06-13 16:52:05 -0400 |
---|---|---|
committer | Doug Hellmann <doug@doughellmann.com> | 2017-06-13 16:52:05 -0400 |
commit | d3b2b79f23ac9125a296fd7972e9a8c0c29e320e (patch) | |
tree | 3ff196ac5b4ef207174c18d98858dfd4b1742aaa | |
parent | f62ebcb4b2cefd970387fa778c03bed59a76c0de (diff) | |
download | pbr-d3b2b79f23ac9125a296fd7972e9a8c0c29e320e.tar.gz |
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>
-rw-r--r-- | pbr/tests/test_setup.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pbr/tests/test_setup.py b/pbr/tests/test_setup.py index 7aa74f6..0213603 100644 --- a/pbr/tests/test_setup.py +++ b/pbr/tests/test_setup.py @@ -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( |