diff options
-rw-r--r-- | doc/requirements.txt | 9 | ||||
-rwxr-xr-x | doc/source/conf.py | 7 | ||||
-rw-r--r-- | doc/source/index.rst | 9 | ||||
-rw-r--r-- | lower-constraints.txt | 6 | ||||
-rw-r--r-- | oslotest/base.py | 2 | ||||
-rw-r--r-- | oslotest/mock_fixture.py | 37 | ||||
-rw-r--r-- | oslotest/tests/unit/test_base.py | 2 | ||||
-rw-r--r-- | oslotest/tests/unit/test_log.py | 2 | ||||
-rw-r--r-- | oslotest/tests/unit/test_mock_fixture.py | 2 | ||||
-rw-r--r-- | oslotest/tests/unit/test_output.py | 6 | ||||
-rw-r--r-- | oslotest/tests/unit/test_timeout.py | 3 | ||||
-rw-r--r-- | releasenotes/source/conf.py | 13 | ||||
-rw-r--r-- | requirements.txt | 1 | ||||
-rw-r--r-- | test-requirements.txt | 5 | ||||
-rwxr-xr-x | tools/oslo_run_pre_release_tests | 2 | ||||
-rw-r--r-- | tox.ini | 4 |
16 files changed, 60 insertions, 50 deletions
diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..32ef3d9 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,9 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +sphinx>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.2.0 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD +oslo.config>=5.2.0 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index f9726a3..789874b 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -28,7 +28,6 @@ modindex_common_prefix = ['oslotest.'] master_doc = 'index' # General information about the project. -project = u'oslotest' copyright = u'2014-2019, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. @@ -51,9 +50,9 @@ html_theme = 'openstackdocs' # -- openstackdocstheme configuration ---------------------------------------- -repository_name = 'openstack/oslotest' -bug_project = 'oslotest' -bug_tag = '' +openstackdocs_repo_name = 'openstack/oslotest' +openstackdocs_bug_project = 'oslotest' +openstackdocs_bug_tag = '' # sphinxcontrib.apidoc options apidoc_module_dir = '../../oslotest' diff --git a/doc/source/index.rst b/doc/source/index.rst index 8a672a7..7e4bbe3 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -2,6 +2,9 @@ oslotest -- OpenStack Testing Framework and Utilities ===================================================== +Contents +======== + .. toctree:: :maxdepth: 2 @@ -10,6 +13,12 @@ oslotest -- OpenStack Testing Framework and Utilities user/index reference/index +Release Notes +============= + +Read also the `oslotest Release Notes +<https://docs.openstack.org/releasenotes/oslotest/>`_. + Indices and tables ================== diff --git a/lower-constraints.txt b/lower-constraints.txt index e4c72a1..af76ba9 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -15,9 +15,7 @@ keystoneauth1==3.4.0 linecache2==1.0.0 MarkupSafe==1.0 mccabe==0.2.1 -mock==2.0.0 netaddr==0.7.18 -openstackdocstheme==1.18.1 oslo.config==5.2.0 oslo.i18n==3.15.3 pbr==2.0.0 @@ -28,15 +26,11 @@ python-mimeparse==1.6.0 python-subunit==1.0.0 pytz==2013.6 PyYAML==3.12 -reno==2.5.0 requests==2.14.2 requestsexceptions==1.2.0 rfc3986==0.3.1 six==1.10.0 snowballstemmer==1.2.1 -Sphinx==1.6.5 -sphinxcontrib-apidoc===0.2.0 -sphinxcontrib-websupport==1.0.1 stestr==2.0.0 stevedore==1.20.0 testrepository==0.0.18 diff --git a/oslotest/base.py b/oslotest/base.py index fb4b02d..acb7a33 100644 --- a/oslotest/base.py +++ b/oslotest/base.py @@ -16,6 +16,7 @@ """Common utilities used in testing""" import logging +from unittest import mock import fixtures from oslotest import createfile @@ -23,7 +24,6 @@ from oslotest import log from oslotest import output from oslotest import timeout -from six.moves import mock import testtools LOG = logging.getLogger(__name__) diff --git a/oslotest/mock_fixture.py b/oslotest/mock_fixture.py index 506cfbd..4e3deab 100644 --- a/oslotest/mock_fixture.py +++ b/oslotest/mock_fixture.py @@ -15,9 +15,9 @@ # under the License. import functools +from unittest import mock import fixtures -import mock def _lazy_autospec_method(mocked_method, original_method, eat_self): @@ -72,8 +72,10 @@ class _AutospecMockMixin(object): original_attr = getattr(original_spec, name) if callable(original_attr): # lazily autospec callable attribute. - eat_self = mock.mock._must_skip(original_spec, name, - isinstance(original_spec, type)) + eat_self = mock._must_skip( + original_spec, name, + isinstance(original_spec, type) + ) _lazy_autospec_method(attr, original_attr, eat_self) @@ -110,15 +112,17 @@ class MockAutospecFixture(fixtures.Fixture): super(MockAutospecFixture, self).setUp() # patch both external and internal usage of Mock / MagicMock. - self.useFixture(fixtures.MonkeyPatch('mock.Mock', _AutospecMock)) - self.useFixture(fixtures.MonkeyPatch('mock.mock.Mock', _AutospecMock)) - self.useFixture(fixtures.MonkeyPatch('mock.MagicMock', - _AutospecMagicMock)) - self.useFixture(fixtures.MonkeyPatch('mock.mock.MagicMock', - _AutospecMagicMock)) + self.useFixture( + fixtures.MonkeyPatch( + 'unittest.mock.Mock', + _AutospecMock)) + self.useFixture( + fixtures.MonkeyPatch( + 'unittest.mock.MagicMock', + _AutospecMagicMock)) -class _patch(mock.mock._patch): +class _patch(mock._patch): """Patch class with working autospec functionality. Currently, mock.patch functionality doesn't handle the autospec parameter @@ -159,8 +163,11 @@ class _patch(mock.mock._patch): if autospec: target = self.getter() original_attr = getattr(target, self.attribute) - eat_self = mock.mock._must_skip(target, self.attribute, - isinstance(target, type)) + eat_self = mock._must_skip( + target, + self.attribute, + isinstance(target, type) + ) new = super(_patch, self).__enter__() @@ -186,11 +193,11 @@ def _safe_attribute_error_wrapper(func): def patch_mock_module(): """Replaces the mock.patch class.""" - mock.mock._patch = _patch + mock._patch = _patch # NOTE(claudiub): mock cannot autospec partial functions properly, # especially those created by LazyLoader objects (scheduler client), # as it will try to copy the partial function's __name__ (which they do # not have). - mock.mock._copy_func_details = _safe_attribute_error_wrapper( - mock.mock._copy_func_details) + mock._copy_func_details = _safe_attribute_error_wrapper( + mock._copy_func_details) diff --git a/oslotest/tests/unit/test_base.py b/oslotest/tests/unit/test_base.py index b98c672..86e76d4 100644 --- a/oslotest/tests/unit/test_base.py +++ b/oslotest/tests/unit/test_base.py @@ -17,10 +17,10 @@ import logging import os import unittest +from unittest import mock import fixtures import six -from six.moves import mock import testtools from oslotest import base diff --git a/oslotest/tests/unit/test_log.py b/oslotest/tests/unit/test_log.py index 55c02a0..f5fdc49 100644 --- a/oslotest/tests/unit/test_log.py +++ b/oslotest/tests/unit/test_log.py @@ -15,8 +15,8 @@ # under the License. import logging +from unittest import mock -from six.moves import mock import testtools from oslotest import log diff --git a/oslotest/tests/unit/test_mock_fixture.py b/oslotest/tests/unit/test_mock_fixture.py index e578fb4..896bbcb 100644 --- a/oslotest/tests/unit/test_mock_fixture.py +++ b/oslotest/tests/unit/test_mock_fixture.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock import testtools +from unittest import mock from oslotest import mock_fixture diff --git a/oslotest/tests/unit/test_output.py b/oslotest/tests/unit/test_output.py index b4abcf0..1f67ba8 100644 --- a/oslotest/tests/unit/test_output.py +++ b/oslotest/tests/unit/test_output.py @@ -13,12 +13,12 @@ # under the License. import sys +from unittest import mock -from oslotest import output - -from six.moves import mock import testtools +from oslotest import output + class CaptureOutputTest(testtools.TestCase): diff --git a/oslotest/tests/unit/test_timeout.py b/oslotest/tests/unit/test_timeout.py index 38c7a3d..9c0b32c 100644 --- a/oslotest/tests/unit/test_timeout.py +++ b/oslotest/tests/unit/test_timeout.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from six.moves import mock +from unittest import mock + import testtools from oslotest import timeout diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index b3e6d49..303a9d7 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -47,14 +47,9 @@ pygments_style = 'sphinx' # a list of builtin themes. html_theme = 'openstackdocs' -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' -html_last_updated_fmt = '%Y-%m-%d %H:%M' - - # -- openstackdocstheme configuration ------------------------------------- -repository_name = 'openstack/oslotest' -bug_project = 'oslotest' -bug_tag = '' +openstackdocs_repo_name = 'openstack/oslotest' +openstackdocs_bug_project = 'oslotest' +openstackdocs_bug_tag = '' +openstackdocs_auto_name = False diff --git a/requirements.txt b/requirements.txt index 9826c3b..32baed1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,3 @@ fixtures>=3.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD six>=1.10.0 # MIT testtools>=2.2.0 # MIT -mock>=2.0.0 # BSD diff --git a/test-requirements.txt b/test-requirements.txt index ed8acfa..758471d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,10 +9,5 @@ hacking>=2.0.0,<2.1.0 # Apache-2.0 # deps = {[testenv]deps} coverage coverage!=4.4,>=4.0 # Apache-2.0 -# this is required for the docs build jobs -sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD -openstackdocstheme>=1.18.1 # Apache-2.0 -sphinxcontrib-apidoc>=0.2.0 # BSD oslo.config>=5.2.0 # Apache-2.0 stestr>=2.0.0 -reno>=2.5.0 # Apache-2.0 diff --git a/tools/oslo_run_pre_release_tests b/tools/oslo_run_pre_release_tests index ecaa55d..4fc0d5c 100755 --- a/tools/oslo_run_pre_release_tests +++ b/tools/oslo_run_pre_release_tests @@ -14,8 +14,6 @@ """Run unit tests for projects that use a library. """ -from __future__ import print_function - import glob import os import subprocess @@ -27,11 +27,15 @@ commands = commands = {posargs} [testenv:docs] +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html [testenv:releasenotes] +deps = {[testenv:docs]deps} commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:lower-constraints] |