mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-25 07:08:13 -07:00
dev-python/mock: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -1,3 +1 @@
|
||||
DIST mock-4.0.3.gh.tar.gz 80318 BLAKE2B bc0dc8b97129eaa2f0f9c89898157ea5de398f59f4e2ebc07318cf745b74d1f1bcc989774600ec88ce1956f9fe16f9464f101ea5df5cd23b3a58b432d19feb8a SHA512 adfdab253eb3bc1b6cb767c58ffa3a8a5c5f88da0f04ea6680e0d87da59177972d2d99bfe0a770ac2ed4f809ca6a090a9d0f789eea8f4365ef2c54f8e8792e89
|
||||
DIST mock-5.0.0.gh.tar.gz 83866 BLAKE2B 7c0718f8d43325b293b070f37c39ccf539a80460ac7e7b724674deb02154157a7dd62a81cd439e19589cee66f256f111f0feec9f8790f16c70948fac3745b43b SHA512 acde3099cb8daf49dffc390faffc45f94c9f1dd24f196ef613b0677cd88d1b55b5cbd04604ff540731e919784242c1cc341065fae99c347c6dfbb3d8115fc2fe
|
||||
DIST mock-5.0.1.gh.tar.gz 84539 BLAKE2B ac50d187974a671db096222af0d0f27add771959553387ca8402951c17ed8e2b9669fff7b147fbc7aca25abc4b5006f5f9d3c2b13f6626a9bea140f6738b3f78 SHA512 b387137632237fa9079a0f70d8724e28bc1833c49d6e14f8fbc357064cf495f6177c783db9448343c0bea98936fc5c3667ce625f5dcdaca851a2f9cc7e3e5639
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
From f3e3d82aab0ede7e25273806dc0505574d85eae2 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Withers <chris@simplistix.co.uk>
|
||||
Date: Thu, 15 Apr 2021 08:27:25 +0100
|
||||
Subject: [PATCH] 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 @@ from mock import (
|
||||
create_autospec, mock
|
||||
)
|
||||
from mock.mock import _Call, _CallList
|
||||
+import mock.mock as mock_module
|
||||
|
||||
|
||||
class Iter(object):
|
||||
@@ -47,7 +48,7 @@ class MockTest(unittest.TestCase):
|
||||
# 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 @@ class MockTest(unittest.TestCase):
|
||||
# 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 @@ class MockTest(unittest.TestCase):
|
||||
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 @@ class MockTest(unittest.TestCase):
|
||||
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)
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{9..11} pypy3 )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Rolling backport of unittest.mock for all Pythons"
|
||||
HOMEPAGE="
|
||||
https://github.com/testing-cabal/mock/
|
||||
https://pypi.org/project/mock/
|
||||
"
|
||||
SRC_URI="
|
||||
https://github.com/testing-cabal/mock/archive/${PV}.tar.gz
|
||||
-> ${P}.gh.tar.gz
|
||||
"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-python/six-1.9[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND=${RDEPEND}
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-py310.patch
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_install_all() {
|
||||
local DOCS=( CHANGELOG.rst README.rst )
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{9..11} pypy3 )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Rolling backport of unittest.mock for all Pythons"
|
||||
HOMEPAGE="
|
||||
https://github.com/testing-cabal/mock/
|
||||
https://pypi.org/project/mock/
|
||||
"
|
||||
SRC_URI="
|
||||
https://github.com/testing-cabal/mock/archive/${PV}.tar.gz
|
||||
-> ${P}.gh.tar.gz
|
||||
"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_install_all() {
|
||||
local DOCS=( CHANGELOG.rst README.rst )
|
||||
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
Reference in New Issue
Block a user