Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mock for openSUSE:Factory checked in at 2021-12-25 20:16:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mock (Old) and /work/SRC/openSUSE:Factory/.python-mock.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mock" Sat Dec 25 20:16:29 2021 rev:28 rq:941560 version:4.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mock/python-mock.changes 2021-02-01 13:28:25.910124402 +0100 +++ /work/SRC/openSUSE:Factory/.python-mock.new.2520/python-mock.changes 2021-12-25 20:16:36.193247533 +0100 @@ -1,0 +2,8 @@ +Sun Dec 19 12:36:47 UTC 2021 - Ben Greiner <[email protected]> + +- Add mock-pr497-fixmixup-496.patch fix mixup of import in + Python 3.10 + * gh#/testing-cabal#496 + * gh#/testing-cabal#497 + +------------------------------------------------------------------- New: ---- mock-pr497-fixmixup-496.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mock.spec ++++++ --- /var/tmp/diff_new_pack.UwYBLu/_old 2021-12-25 20:16:37.473248575 +0100 +++ /var/tmp/diff_new_pack.UwYBLu/_new 2021-12-25 20:16:37.477248579 +0100 @@ -1,5 +1,5 @@ # -# spec file for package python-mock +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -16,7 +16,7 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -33,14 +33,14 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: http://www.voidspace.org.uk/python/mock/ -# no tests in sdis -# Source: https://files.pythonhosted.org/packages/source/m/mock/mock-%{version}.tar.gz +# no tests in PyPI sdist, use Github Source: https://github.com/testing-cabal/mock/archive/%{version}.tar.gz +# PATCH-FIX-UPSTREAM mock-pr497-fixmixup-496.patch -- fix mixup of import, gh#/testing-cabal#496 +Patch0: https://github.com/testing-cabal/mock/pull/497.patch#/mock-pr497-fixmixup-496.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros %if %{with test} -BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest} %endif BuildArch: noarch @@ -55,7 +55,7 @@ needed attributes in the normal way. %prep -%setup -q -n mock-%{version} +%autosetup -p1 -n mock-%{version} %build %python_build @@ -75,7 +75,8 @@ %files %{python_files} %license LICENSE.txt %doc README.rst CHANGELOG.rst -%{python_sitelib}/* +%{python_sitelib}/mock +%{python_sitelib}/mock-%{version}*-info %endif %changelog ++++++ mock-pr497-fixmixup-496.patch ++++++ >From 67ca856792f8655d4043885facfcf1450a2c4ddb Mon Sep 17 00:00:00 2001 From: Chris Withers <[email protected]> Date: Sat, 10 Apr 2021 20:06:10 +0100 Subject: [PATCH 1/3] move to matrix and add 3.9 --- .circleci/config.yml | 59 ++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9855ef7..4564ec2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,26 +24,21 @@ jobs: common: &common jobs: + - python/pip-run-tests: - name: python36 - image: circleci/python:3.6 - - python/pip-run-tests: - name: python37 - image: circleci/python:3.7 - - python/pip-run-tests: - name: python38 - image: circleci/python:3.8 - - python/pip-run-tests: - name: pypy36 - image: pypy:3.6 + matrix: + parameters: + image: + - circleci/python:3.6 + - circleci/python:3.7 + - circleci/python:3.8 + - circleci/python:3.9 + - pypy:3.6 - python/coverage: name: coverage requires: - - python36 - - python37 - - python38 - - pypy36 + - python/pip-run-tests - python/pip-docs: name: docs @@ -59,27 +54,14 @@ common: &common only: master - check-package: - name: check-package-python36 - image: circleci/python:3.6 - requires: - - package - - - check-package: - name: check-package-python37 - image: circleci/python:3.7 - requires: - - package - - - check-package: - name: check-package-python38 - image: circleci/python:3.8 - requires: - - package - - - check-package: - name: check-package-pypy36 - image: pypy:3.6 - python: pypy3 + matrix: + parameters: + image: + - circleci/python:3.6 + - circleci/python:3.7 + - circleci/python:3.8 + - circleci/python:3.9 + - pypy:3.6 requires: - package @@ -87,10 +69,7 @@ common: &common name: release config: .carthorse.yml requires: - - check-package-python36 - - check-package-python37 - - check-package-python38 - - check-package-pypy36 + - check-package workflows: push: >From e293a82592401306f2cdca91c048acf59503bcf8 Mon Sep 17 00:00:00 2001 From: Chris Withers <[email protected]> Date: Thu, 15 Apr 2021 08:23:18 +0100 Subject: [PATCH 2/3] remove unused tox.ini --- tox.ini | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 tox.ini diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 14eb4f4..0000000 --- a/tox.ini +++ /dev/null @@ -1,12 +0,0 @@ -[tox] -envlist = py36,py37,py38,docs - -[testenv] -commands = - {envbindir}/pytest {posargs} - -[testenv:docs] -deps = - sphinx -commands = - {envbindir}/python setup.py build_sphinx >From f57ca71ba69596cd30e5abd36d197e8014377982 Mon Sep 17 00:00:00 2001 From: Chris Withers <[email protected]> Date: Thu, 15 Apr 2021 08:27:25 +0100 Subject: [PATCH 3/3] fix tests that should test mock but were testing unittest.mock --- mock/tests/testmock.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mock/tests/testmock.py b/mock/tests/testmock.py index 5702b6d..1a70909 100644 --- a/mock/tests/testmock.py +++ b/mock/tests/testmock.py @@ -13,6 +13,7 @@ create_autospec, mock ) from mock.mock import _Call, _CallList +import mock.mock as mock_module class Iter(object): @@ -47,7 +48,7 @@ def test_all(self): # if __all__ is badly defined then import * will raise an error # We have to exec it because you can't import * inside a method # in Python 3 - exec("from unittest.mock import *") + exec("from mock.mock import *") def test_constructor(self): @@ -2137,16 +2138,16 @@ def test_isinstance_under_settrace(self): # test_patch_dict_test_prefix and test_patch_test_prefix not restoring # causes the objects patched to go out of sync - old_patch = unittest.mock.patch + old_patch = mock_module.patch # Directly using __setattr__ on unittest.mock causes current imported # reference to be updated. Use a lambda so that during cleanup the # re-imported new reference is updated. - self.addCleanup(lambda patch: setattr(unittest.mock, 'patch', patch), + self.addCleanup(lambda patch: setattr(mock_module, 'patch', patch), old_patch) with patch.dict('sys.modules'): - del sys.modules['unittest.mock'] + del sys.modules['mock'] # This trace will stop coverage being measured ;-) def trace(frame, event, arg): # pragma: no cover @@ -2155,7 +2156,7 @@ def trace(frame, event, arg): # pragma: no cover self.addCleanup(sys.settrace, sys.gettrace()) sys.settrace(trace) - from unittest.mock import ( + from mock.mock import ( Mock, MagicMock, NonCallableMock, NonCallableMagicMock ) @@ -2170,10 +2171,10 @@ def trace(frame, event, arg): # pragma: no cover def test_bool_not_called_when_passing_spec_arg(self): class Something: def __init__(self): - self.obj_with_bool_func = unittest.mock.MagicMock() + self.obj_with_bool_func = mock_module.MagicMock() obj = Something() - with unittest.mock.patch.object(obj, 'obj_with_bool_func', autospec=True): pass + with mock_module.patch.object(obj, 'obj_with_bool_func', autospec=True): pass self.assertEqual(obj.obj_with_bool_func.__bool__.call_count, 0)
