diff -Nru python-oslotest-3.0.0/AUTHORS python-oslotest-3.2.0/AUTHORS --- python-oslotest-3.0.0/AUTHORS 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/AUTHORS 2018-01-09 15:24:40.000000000 +0000 @@ -1,6 +1,7 @@ Alessio Ababilov Alex Meade Alexander Gorodnev +Andreas Jaeger Angus Salkeld Ben Nemec Brant Knudson @@ -8,6 +9,7 @@ ChangBo Guo(gcb) Christian Berendt Chuck Short +Claudiu Belu Danek Duvall Davanum Srinivas Davanum Srinivas diff -Nru python-oslotest-3.0.0/ChangeLog python-oslotest-3.2.0/ChangeLog --- python-oslotest-3.0.0/ChangeLog 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/ChangeLog 2018-01-09 15:24:40.000000000 +0000 @@ -1,6 +1,20 @@ CHANGES ======= +3.2.0 +----- + +* Adds mock autospec fixture + +3.1.0 +----- + +* Remove -U from pip install +* Avoid tox\_install.sh for constraints support +* Updated from global requirements +* Remove setting of version/release from releasenotes +* Updated from global requirements + 3.0.0 ----- diff -Nru python-oslotest-3.0.0/debian/changelog python-oslotest-3.2.0/debian/changelog --- python-oslotest-3.0.0/debian/changelog 2017-11-14 10:58:59.000000000 +0000 +++ python-oslotest-3.2.0/debian/changelog 2018-01-24 19:14:34.000000000 +0000 @@ -1,3 +1,13 @@ +python-oslotest (1:3.2.0-0ubuntu1) bionic; urgency=medium + + * New upstream release. + * d/*: wrap-and-sort -bast. + * d/control: Align (Build-)Depends with upstream. + * d/control: Update Standards-Version to 4.1.2. + * d/control: Bump debhelper compat to 10. + + -- Corey Bryant Wed, 24 Jan 2018 14:14:34 -0500 + python-oslotest (1:3.0.0-0ubuntu1) bionic; urgency=medium * New upstream release. diff -Nru python-oslotest-3.0.0/debian/compat python-oslotest-3.2.0/debian/compat --- python-oslotest-3.0.0/debian/compat 2017-11-14 10:58:59.000000000 +0000 +++ python-oslotest-3.2.0/debian/compat 2018-01-24 19:14:34.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru python-oslotest-3.0.0/debian/control python-oslotest-3.2.0/debian/control --- python-oslotest-3.0.0/debian/control 2017-11-14 10:58:59.000000000 +0000 +++ python-oslotest-3.2.0/debian/control 2018-01-24 19:14:34.000000000 +0000 @@ -3,46 +3,50 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: PKG OpenStack -Uploaders: Thomas Goirand , - Ivan Udovichenko , - Corey Bryant , - David Della Vecchia , -Build-Depends: debhelper (>= 9), - dh-python, - openstack-pkg-tools (>= 0.23~), - python-all, - python-pbr, - python-setuptools, - python-sphinx, - python3-all, - python3-pbr, - python3-setuptools -Build-Depends-Indep: python-coverage (>= 4.0), - python-fixtures (>= 3.0.0), - python-mock (>= 2.0.0), - python-mox3 (>= 0.7.0), - python-openstackdocstheme (>= 1.17.0), - python-os-client-config (>= 1.28.0), - python-oslo.config (>= 1:4.6.0), - python-six (>= 1.9.0), - python-testrepository (>= 0.0.18), - python-testscenarios, - python-testtools (>= 1.4.0), - python3-coverage (>= 4.0), - python3-fixtures (>= 3.0.0), - python3-mock (>= 2.0.0), - python3-mox3 (>= 0.7.0), - python3-openstackdocstheme (>= 1.17.0), - python3-os-client-config (>= 1.28.0), - python3-oslo.config (>= 1:4.6.0), - python3-six (>= 1.9.0), - python3-subunit, - python3-testrepository (>= 0.0.18), - python3-testscenarios, - python3-testtools (>= 1.4.0), - subunit, - testrepository -Standards-Version: 3.9.8 +Uploaders: + Thomas Goirand , + Ivan Udovichenko , + Corey Bryant , + David Della Vecchia , +Build-Depends: + debhelper (>= 10), + dh-python, + openstack-pkg-tools (>= 0.23~), + python-all, + python-pbr, + python-setuptools, + python-sphinx (>= 1.6.2), + python3-all, + python3-pbr, + python3-setuptools, + python3-sphinx (>= 1.6.2), +Build-Depends-Indep: + python-coverage (>= 4.0), + python-fixtures (>= 3.0.0), + python-mock (>= 2.0.0), + python-mox3 (>= 0.20.0), + python-openstackdocstheme (>= 1.17.0), + python-os-client-config (>= 1.28.0), + python-oslo.config (>= 1:5.1.0), + python-six (>= 1.10.0), + python-testrepository (>= 0.0.18), + python-testscenarios, + python-testtools (>= 2.2.0), + python3-coverage (>= 4.0), + python3-fixtures (>= 3.0.0), + python3-mock (>= 2.0.0), + python3-mox3 (>= 0.20.0), + python3-openstackdocstheme (>= 1.17.0), + python3-os-client-config (>= 1.28.0), + python3-oslo.config (>= 1:5.1.0), + python3-six (>= 1.10.0), + python3-subunit (>= 1.0.0), + python3-testrepository (>= 0.0.18), + python3-testscenarios, + python3-testtools (>= 2.2.0), + subunit, + testrepository, +Standards-Version: 4.1.2 Vcs-Browser: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-oslotest Vcs-Git: git://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-oslotest Homepage: https://launchpad.net/oslo @@ -50,53 +54,57 @@ Package: python-oslotest Architecture: all -Depends: python-fixtures (>= 3.0.0), - python-mock (>= 2.0.0), - python-mox3 (>= 0.7.0), - python-os-client-config (>= 1.28.0), - python-pbr (>= 2.0.0), - python-six (>= 1.9.0), - python-subunit (>= 0.0.18), - python-testrepository (>= 0.0.18), - python-testscenarios (>= 0.4), - python-testtools (>= 1.4.0), - subunit (>= 0.0.18), - testrepository (>= 0.0.18), - ${misc:Depends}, - ${python:Depends} +Depends: + python-fixtures (>= 3.0.0), + python-mock (>= 2.0.0), + python-mox3 (>= 0.20.0), + python-os-client-config (>= 1.28.0), + python-pbr (>= 2.0.0), + python-six (>= 1.10.0), + python-subunit (>= 1.0.0), + python-testrepository (>= 0.0.18), + python-testscenarios (>= 0.4), + python-testtools (>= 2.2.0), + subunit (>= 0.0.18), + testrepository (>= 0.0.18), + ${misc:Depends}, + ${python:Depends}, Description: OpenStack test framework - Python 2.x OpenStack test framework that provides base classes and fixtures for creating unit and functional tests. . This package contains the Python 2.x module. -Package: python3-oslotest +Package: python-oslotest-doc +Section: doc Architecture: all -Depends: python3-fixtures (>= 3.0.0), - python3-mock (>= 2.0.0), - python3-mox3 (>= 0.7.0), - python3-os-client-config (>= 1.28.0), - python3-pbr (>= 2.0.0), - python3-six (>= 1.9.0), - python3-subunit (>= 0.0.18), - python3-testrepository (>= 0.0.18), - python3-testscenarios (>= 0.4), - python3-testtools (>= 1.4.0), - testrepository (>= 0.0.18), - ${misc:Depends}, - ${python3:Depends} -Description: OpenStack test framework - Python 3.x +Depends: + ${misc:Depends}, + ${sphinxdoc:Depends}, +Description: OpenStack test framework - doc OpenStack test framework that provides base classes and fixtures for creating unit and functional tests. . - This package contains the Python 3.x module. + This package contains the documentation. -Package: python-oslotest-doc -Section: doc +Package: python3-oslotest Architecture: all -Depends: ${misc:Depends}, ${sphinxdoc:Depends} -Description: OpenStack test framework - doc +Depends: + python3-fixtures (>= 3.0.0), + python3-mock (>= 2.0.0), + python3-mox3 (>= 0.20.0), + python3-os-client-config (>= 1.28.0), + python3-pbr (>= 2.0.0), + python3-six (>= 1.10.0), + python3-subunit (>= 1.0.0), + python3-testrepository (>= 0.0.18), + python3-testscenarios (>= 0.4), + python3-testtools (>= 2.2.0), + testrepository (>= 0.0.18), + ${misc:Depends}, + ${python3:Depends}, +Description: OpenStack test framework - Python 3.x OpenStack test framework that provides base classes and fixtures for creating unit and functional tests. . - This package contains the documentation. + This package contains the Python 3.x module. diff -Nru python-oslotest-3.0.0/doc/source/user/index.rst python-oslotest-3.2.0/doc/source/user/index.rst --- python-oslotest-3.0.0/doc/source/user/index.rst 2017-11-13 15:24:37.000000000 +0000 +++ python-oslotest-3.2.0/doc/source/user/index.rst 2018-01-09 15:22:14.000000000 +0000 @@ -8,6 +8,7 @@ features debugging testing + mock-autospec cross-testing resources history \ No newline at end of file diff -Nru python-oslotest-3.0.0/doc/source/user/mock-autospec.rst python-oslotest-3.2.0/doc/source/user/mock-autospec.rst --- python-oslotest-3.0.0/doc/source/user/mock-autospec.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-oslotest-3.2.0/doc/source/user/mock-autospec.rst 2018-01-09 15:22:14.000000000 +0000 @@ -0,0 +1,96 @@ +============= +Mock autospec +============= + +In typical unit tests, almost all of the dependencies are mocked or patched +(``mock.patch``), without any guarantee that the mocked methods actually exist, +or if their signatures are respected. Because of this, actual issues can be +easily overlooked and missed, as the unit tests are wrongfully passing. + +The ``mock.Mock`` class accepts a spec as an argument, which only solves half +the problem: it only checks if an attribute exists, based on the given spec. It +does not guarantee that the given attribute is actually a method, or if its +signature is respected. The Mock class does not accept an autospec argument [1]. + +``mock.patch``, ``mock.patch.object``, ``mock.patch.multiple`` accept an +autospec argument, but because of a bug [2], it cannot be used properly. + +oslotest offers a solution for problems mentioned above. + +1. https://github.com/testing-cabal/mock/issues/393 +2. https://github.com/testing-cabal/mock/issues/396 + + +Patching the ``mock`` module +============================ + +The ``oslotest.mock_fixture`` module contains 2 components: + +- patch_mock_module +- MockAutospecFixture + +Both components need to be used in order to fix various issues within ``mock`` +regarding autospec. + +patch_mock_module +----------------- + +At the moment, ``mock.patch``, ``mock.patch.object``, ``mock.patch.multiple`` +accepts the ``autospec`` argument, but it does not correctly consume the +self / cls argument of methods or class methods. + +``patch_mock_module`` addresses this issue. In order to make sure that the +original version of ``mock.patch`` is not used by the unit tests, this +function has to be called as early as possible within the test module, or +the base test module. E.g.:: + + nova/test.py + ... + from oslotest import mock_fixture + + mock_fixture.patch_mock_module() + +Additionally, this function will set the ``autospec`` argument's value +to ``True``, unless otherwise specified or these arguments are passed in: +``new_callable, create, spec``. + +MockAutospecFixture +------------------- + +``mock.Mock`` and ``mock.MagicMock`` classes do not accept any ``autospec`` +argument. This fixture will replace the ``mock.Mock`` and ``mock.MagicMock`` +classes with subclasses which accepts the said argument. + +The fixture can be used in the test ``setUp`` method. E.g.:: + + nova/test.py + ... + from oslotest import mock_fixture + + class TestCase(testtools.TestCase): + def setUp(self): + super(TestCase, self).setUp() + self.useFixture(mock_fixture.MockAutospecFixture()) + + +Mock autospec usage +=================== + +Consider the following class as an example:: + + class Foo(object): + def bar(self, a, b, c, d=None): + pass + +Using the setup described above, the following unit tests will now pass +correctly:: + + class FooTestCase(TestCase): + def test_mock_bar(self): + mock_foo = mock.Mock(autospec=Foo) + self.assertRaises(TypeError, mock_foo.bar, invalid='argument') + + @mock.patch.object(Foo, 'bar', autospec=True) + def test_patch_bar(self, mock_bar): + foo = Foo() + self.assertRaises(TypeError, foo.bar, invalid='argument') diff -Nru python-oslotest-3.0.0/oslotest/mock_fixture.py python-oslotest-3.2.0/oslotest/mock_fixture.py --- python-oslotest-3.0.0/oslotest/mock_fixture.py 1970-01-01 00:00:00.000000000 +0000 +++ python-oslotest-3.2.0/oslotest/mock_fixture.py 2018-01-09 15:22:14.000000000 +0000 @@ -0,0 +1,185 @@ + +# Copyright 2017 Cloudbase Solutions Srl +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import functools + +import fixtures +import mock + + +def _lazy_autospec_method(mocked_method, original_method, eat_self): + if mocked_method._mock_check_sig.__dict__.get('autospeced'): + return + + _lazy_autospec = mock.create_autospec(original_method) + if eat_self: + # consume self argument. + _lazy_autospec = functools.partial(_lazy_autospec, None) + + def _autospeced(*args, **kwargs): + _lazy_autospec(*args, **kwargs) + + # _mock_check_sig is called by the mock's __call__ method. + # which means that if a method is not called, _autospeced is not + # called. + _autospeced.__dict__['autospeced'] = True + mocked_method._mock_check_sig = _autospeced + + +class _AutospecMockMixin(object): + """Mock object that lazily autospecs the given spec's methods.""" + + def __init__(self, *args, **kwargs): + super(_AutospecMockMixin, self).__init__(*args, **kwargs) + self.__dict__['_autospec'] = kwargs.get('autospec') + _mock_methods = self.__dict__['_mock_methods'] + if _mock_methods: + # this will allow us to be able to set _mock_check_sig if + # the spec_set argument has been given. + _mock_methods.append('_mock_check_sig') + + def __getattr__(self, name): + attr = super(_AutospecMockMixin, self).__getattr__(name) + + original_spec = self.__dict__['_autospec'] + if not original_spec: + return attr + + if not hasattr(original_spec, name): + raise AttributeError(name) + + # check if the original attribute is callable, and the mock was not + # autospeced already. + 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)) + + _lazy_autospec_method(attr, original_attr, eat_self) + + return attr + + +class _AutospecMock(_AutospecMockMixin, mock.Mock): + pass + + +class _AutospecMagicMock(_AutospecMockMixin, mock.MagicMock): + pass + + +class MockAutospecFixture(fixtures.Fixture): + """A fixture to add / fix the autospec feature into the mock library. + + The current version of the mock library has a few unaddressed issues, which + can lead to erroneous unit tests, and can hide actual issues. This fixture + is to be removed once these issues have been addressed in the mock library. + + Issue addressed by the fixture: + + * mocked method's signature checking: + - https://github.com/testing-cabal/mock/issues/393 + - mock can only accept a spec object / class, and it makes sure that + that attribute exists, but it does not check whether the given + attribute is callable, or if its signature is respected in any way. + - adds autospec argument. If the autospec argument is given, the + mocked method's signature is also checked. + """ + + def setUp(self): + 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.mock.MagicMock', + _AutospecMagicMock)) + self.useFixture(fixtures.MonkeyPatch('mock.mock.MagicMock', + _AutospecMagicMock)) + + +class _patch(mock.mock._patch): + """Patch class with working autospec functionality. + + Currently, mock.patch functionality doesn't handle the autospec parameter + properly (the self argument is not consumed, causing assertions to fail). + Until the issue is addressed in the mock library, this should be used + instead. + https://github.com/testing-cabal/mock/issues/396 + """ + + def __init__(self, *args, **kwargs): + super(_patch, self).__init__(*args, **kwargs) + + # By default, autospec is None. We will consider it as True. + autospec = True if self.autospec is None else self.autospec + + # in some cases, autospec cannot be set to True. + skip_autospec = (getattr(self, attr) for attr in + ['new_callable', 'create', 'spec']) + # NOTE(claudiub): The "new" argument is always mock.DEFAULT, unless + # explicitly set otherwise. + if self.new is not mock.DEFAULT or any(skip_autospec): + # cannot autospec if new, new_callable, or create arguments given. + autospec = False + elif self.attribute: + target = getattr(self.getter(), self.attribute, None) + if isinstance(target, mock.Mock): + # NOTE(claudiub): shouldn't autospec already mocked targets. + # this can cause some issues. There are quite a few tests + # which patch mocked methods. + autospec = False + + # NOTE(claudiub): reset the self.autospec property, so we can handle + # the autospec scenario ourselves. + self._autospec = autospec + self.autospec = None + + def __enter__(self): + if self._autospec: + target = self.getter() + original_attr = getattr(target, self.attribute) + eat_self = mock.mock._must_skip(target, self.attribute, + isinstance(target, type)) + + new = super(_patch, self).__enter__() + _lazy_autospec_method(new, original_attr, eat_self) + return new + else: + return super(_patch, self).__enter__() + + +def _safe_attribute_error_wrapper(func): + def wrapper(*args, **kwargs): + try: + return func(*args, **kwargs) + except AttributeError: + pass + + return wrapper + + +def patch_mock_module(): + """Replaces the mock.patch class.""" + mock.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) diff -Nru python-oslotest-3.0.0/oslotest/tests/unit/test_mock_fixture.py python-oslotest-3.2.0/oslotest/tests/unit/test_mock_fixture.py --- python-oslotest-3.0.0/oslotest/tests/unit/test_mock_fixture.py 1970-01-01 00:00:00.000000000 +0000 +++ python-oslotest-3.2.0/oslotest/tests/unit/test_mock_fixture.py 2018-01-09 15:22:14.000000000 +0000 @@ -0,0 +1,104 @@ +# Copyright 2017 Cloudbase Solutions Srl +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import mock +import testtools + +from oslotest import mock_fixture + +# NOTE(claudiub): this needs to be called before any mock.patch calls are +# being done, and especially before the test class loads. This fixes +# the mock.patch autospec issue: +# https://github.com/testing-cabal/mock/issues/396 +# TODO(claudiub): Remove this once the fix has been merged and released. +mock_fixture.patch_mock_module() + + +class Foo(object): + def bar(self, a, b, c, d=None): + pass + + @classmethod + def classic_bar(cls, a, b, c, d=None): + pass + + @staticmethod + def static_bar(a, b, c, d=None): + pass + + +class MockSanityTestCase(testtools.TestCase): + + def setUp(self): + super(MockSanityTestCase, self).setUp() + self.useFixture(mock_fixture.MockAutospecFixture()) + + def _check_autospeced_foo(self, foo): + for method_name in ['bar', 'classic_bar', 'static_bar']: + mock_method = getattr(foo, method_name) + + # check that the methods are callable with correct args. + mock_method(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c) + mock_method(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, + d=mock.sentinel.d) + mock_method.assert_has_calls([ + mock.call(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c), + mock.call(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, + d=mock.sentinel.d)]) + + # assert that TypeError is raised if the method signature is not + # respected. + self.assertRaises(TypeError, mock_method) + self.assertRaises(TypeError, mock_method, mock.sentinel.a) + self.assertRaises(TypeError, mock_method, a=mock.sentinel.a) + self.assertRaises(TypeError, mock_method, mock.sentinel.a, + mock.sentinel.b, mock.sentinel.c, + e=mock.sentinel.e) + + # assert that AttributeError is raised if the method does not exist. + self.assertRaises(AttributeError, getattr, foo, 'lish') + + def test_mock_autospec_all_members(self): + for spec in [Foo, Foo()]: + foo = mock.Mock(autospec=spec) + self._check_autospeced_foo(foo) + + @mock.patch.object(Foo, 'static_bar') + @mock.patch.object(Foo, 'classic_bar') + @mock.patch.object(Foo, 'bar') + def test_patch_autospec_class(self, mock_meth, mock_cmeth, mock_smeth): + foo = Foo() + self._check_autospeced_foo(foo) + + @mock.patch.object(Foo, 'static_bar', autospec=False) + @mock.patch.object(Foo, 'classic_bar', autospec=False) + @mock.patch.object(Foo, 'bar', autospec=False) + def test_patch_autospec_class_false(self, mock_meth, mock_cmeth, + mock_smeth): + foo = Foo() + # we're checking that method signature is not enforced. + foo.bar() + mock_meth.assert_called_once_with() + foo.classic_bar() + mock_cmeth.assert_called_once_with() + foo.static_bar() + mock_smeth.assert_called_once_with() + + @mock.patch.object(Foo, 'lish', create=True) + def test_patch_create(self, mock_lish): + foo = Foo() + + foo.lish() + mock_lish.assert_called_once_with() diff -Nru python-oslotest-3.0.0/oslotest.egg-info/pbr.json python-oslotest-3.2.0/oslotest.egg-info/pbr.json --- python-oslotest-3.0.0/oslotest.egg-info/pbr.json 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/oslotest.egg-info/pbr.json 2018-01-09 15:24:40.000000000 +0000 @@ -1 +1 @@ -{"git_version": "507553b", "is_release": true} \ No newline at end of file +{"git_version": "4f7f49a", "is_release": true} \ No newline at end of file diff -Nru python-oslotest-3.0.0/oslotest.egg-info/PKG-INFO python-oslotest-3.2.0/oslotest.egg-info/PKG-INFO --- python-oslotest-3.0.0/oslotest.egg-info/PKG-INFO 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/oslotest.egg-info/PKG-INFO 2018-01-09 15:24:40.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: oslotest -Version: 3.0.0 +Version: 3.2.0 Summary: Oslo test framework Home-page: https://docs.openstack.org/oslotest/latest/ Author: OpenStack diff -Nru python-oslotest-3.0.0/oslotest.egg-info/requires.txt python-oslotest-3.2.0/oslotest.egg-info/requires.txt --- python-oslotest-3.0.0/oslotest.egg-info/requires.txt 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/oslotest.egg-info/requires.txt 2018-01-09 15:24:40.000000000 +0000 @@ -1,8 +1,8 @@ fixtures>=3.0.0 -python-subunit>=0.0.18 -six>=1.9.0 +python-subunit>=1.0.0 +six>=1.10.0 testrepository>=0.0.18 -testtools>=1.4.0 +testtools>=2.2.0 mock>=2.0.0 mox3>=0.20.0 os-client-config>=1.28.0 diff -Nru python-oslotest-3.0.0/oslotest.egg-info/SOURCES.txt python-oslotest-3.2.0/oslotest.egg-info/SOURCES.txt --- python-oslotest-3.0.0/oslotest.egg-info/SOURCES.txt 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/oslotest.egg-info/SOURCES.txt 2018-01-09 15:24:41.000000000 +0000 @@ -22,6 +22,7 @@ doc/source/user/features.rst doc/source/user/history.rst doc/source/user/index.rst +doc/source/user/mock-autospec.rst doc/source/user/resources.rst doc/source/user/testing.rst oslotest/__init__.py @@ -29,6 +30,7 @@ oslotest/createfile.py oslotest/functional.py oslotest/log.py +oslotest/mock_fixture.py oslotest/modules.py oslotest/moxstubout.py oslotest/output.py @@ -45,6 +47,7 @@ oslotest/tests/unit/test_base.py oslotest/tests/unit/test_createfile.py oslotest/tests/unit/test_log.py +oslotest/tests/unit/test_mock_fixture.py oslotest/tests/unit/test_mockpatch.py oslotest/tests/unit/test_modules.py oslotest/tests/unit/test_moxstubout.py @@ -54,6 +57,7 @@ oslotest/tools/config.py releasenotes/notes/add-reno-996dd44974d53238.yaml releasenotes/notes/deprecate-functional-module-fbed600d2fa026fc.yaml +releasenotes/notes/mock-autospec-fix-9042c30dbb74032f.yaml releasenotes/notes/remove_mockpatch-80fec29f28da5d5c.yaml releasenotes/source/conf.py releasenotes/source/index.rst @@ -64,5 +68,4 @@ releasenotes/source/_templates/.placeholder tools/oslo_debug_helper tools/oslo_run_cross_tests -tools/oslo_run_pre_release_tests -tools/tox_install.sh \ No newline at end of file +tools/oslo_run_pre_release_tests \ No newline at end of file diff -Nru python-oslotest-3.0.0/PKG-INFO python-oslotest-3.2.0/PKG-INFO --- python-oslotest-3.0.0/PKG-INFO 2017-11-13 15:27:35.000000000 +0000 +++ python-oslotest-3.2.0/PKG-INFO 2018-01-09 15:24:41.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: oslotest -Version: 3.0.0 +Version: 3.2.0 Summary: Oslo test framework Home-page: https://docs.openstack.org/oslotest/latest/ Author: OpenStack diff -Nru python-oslotest-3.0.0/releasenotes/notes/mock-autospec-fix-9042c30dbb74032f.yaml python-oslotest-3.2.0/releasenotes/notes/mock-autospec-fix-9042c30dbb74032f.yaml --- python-oslotest-3.0.0/releasenotes/notes/mock-autospec-fix-9042c30dbb74032f.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-oslotest-3.2.0/releasenotes/notes/mock-autospec-fix-9042c30dbb74032f.yaml 2018-01-09 15:22:14.000000000 +0000 @@ -0,0 +1,5 @@ +--- +other: + - | + Oslotest now contains the mock_fixture module, which offers fixes to the + autospec functionality in the mock library. diff -Nru python-oslotest-3.0.0/releasenotes/source/conf.py python-oslotest-3.2.0/releasenotes/source/conf.py --- python-oslotest-3.0.0/releasenotes/source/conf.py 2017-11-13 15:24:37.000000000 +0000 +++ python-oslotest-3.2.0/releasenotes/source/conf.py 2018-01-09 15:21:52.000000000 +0000 @@ -55,16 +55,12 @@ project = u'oslotest Release Notes' copyright = u'2016, oslotest Developers' -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. +# Release notes do not need a version in the title, they span +# multiple versions. # The full version, including alpha/beta/rc tags. -import pkg_resources -release = pkg_resources.get_distribution('oslotest').version +release = '' # The short X.Y version. -version = release +version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -Nru python-oslotest-3.0.0/requirements.txt python-oslotest-3.2.0/requirements.txt --- python-oslotest-3.0.0/requirements.txt 2017-11-13 15:24:37.000000000 +0000 +++ python-oslotest-3.2.0/requirements.txt 2018-01-09 15:21:52.000000000 +0000 @@ -3,10 +3,10 @@ # process, which may cause wedges in the gate later. fixtures>=3.0.0 # Apache-2.0/BSD -python-subunit>=0.0.18 # Apache-2.0/BSD -six>=1.9.0 # MIT +python-subunit>=1.0.0 # Apache-2.0/BSD +six>=1.10.0 # MIT testrepository>=0.0.18 # Apache-2.0/BSD -testtools>=1.4.0 # MIT +testtools>=2.2.0 # MIT mock>=2.0.0 # BSD mox3>=0.20.0 # Apache-2.0 os-client-config>=1.28.0 # Apache-2.0 diff -Nru python-oslotest-3.0.0/test-requirements.txt python-oslotest-3.2.0/test-requirements.txt --- python-oslotest-3.0.0/test-requirements.txt 2017-11-13 15:24:37.000000000 +0000 +++ python-oslotest-3.2.0/test-requirements.txt 2018-01-09 15:21:52.000000000 +0000 @@ -12,6 +12,6 @@ # this is required for the docs build jobs sphinx>=1.6.2 # BSD openstackdocstheme>=1.17.0 # Apache-2.0 -oslo.config>=4.6.0 # Apache-2.0 +oslo.config>=5.1.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 diff -Nru python-oslotest-3.0.0/tools/tox_install.sh python-oslotest-3.2.0/tools/tox_install.sh --- python-oslotest-3.0.0/tools/tox_install.sh 2017-11-13 15:24:37.000000000 +0000 +++ python-oslotest-3.2.0/tools/tox_install.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# Client constraint file contains this client version pin that is in conflict -# with installing the client from source. We should remove the version pin in -# the constraints file before applying it for from-source installation. - -CONSTRAINTS_FILE="$1" -shift 1 - -set -e - -# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get -# published to logs.openstack.org for easy debugging. -localfile="$VIRTUAL_ENV/log/upper-constraints.txt" - -if [[ "$CONSTRAINTS_FILE" != http* ]]; then - CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE" -fi -# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep -curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile" - -pip install -c"$localfile" openstack-requirements - -# This is the main purpose of the script: Allow local installation of -# the current repo. It is listed in constraints file and thus any -# install will be constrained and we need to unconstrain it. -edit-constraints "$localfile" -- "$CLIENT_NAME" - -pip install -c"$localfile" -U "$@" -exit $? diff -Nru python-oslotest-3.0.0/tox.ini python-oslotest-3.2.0/tox.ini --- python-oslotest-3.0.0/tox.ini 2017-11-13 15:24:37.000000000 +0000 +++ python-oslotest-3.2.0/tox.ini 2018-01-09 15:21:52.000000000 +0000 @@ -4,12 +4,11 @@ envlist = py35,py27,pep8 [testenv] -setenv = - VIRTUAL_ENV={envdir} - BRANCH_NAME=master - CLIENT_NAME=oslotest -install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} -deps = -r{toxinidir}/test-requirements.txt +install_command = pip install {opts} {packages} +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' [testenv:pep8]