[arch-commits] Commit in python-mock/trunk (2 files)

Jelle van der Waa jelle at archlinux.org
Mon May 27 18:54:52 UTC 2019


    Date: Monday, May 27, 2019 @ 18:54:52
  Author: jelle
Revision: 471806

upgpkg: python-mock 3.0.5-1

Upstream update, remove obsolete Python2 patch

Modified:
  python-mock/trunk/PKGBUILD
Deleted:
  python-mock/trunk/0001-be-able-to-run-tests-on-python2.patch

--------------------------------------------+
 0001-be-able-to-run-tests-on-python2.patch |   92 ---------------------------
 PKGBUILD                                   |   14 +---
 2 files changed, 6 insertions(+), 100 deletions(-)

Deleted: 0001-be-able-to-run-tests-on-python2.patch
===================================================================
--- 0001-be-able-to-run-tests-on-python2.patch	2019-05-27 18:54:45 UTC (rev 471805)
+++ 0001-be-able-to-run-tests-on-python2.patch	2019-05-27 18:54:52 UTC (rev 471806)
@@ -1,92 +0,0 @@
-From 2d7f6c41e9290ec42eae860582496f744cdc52bd Mon Sep 17 00:00:00 2001
-From: Eli Schwartz <eschwartz at archlinux.org>
-Date: Fri, 3 Aug 2018 11:13:47 -0400
-Subject: [PATCH] be able to run tests on python2
-
-use existing six dependency to access assertRaisesRegexp as assertRaisesRegex
----
- mock/tests/testmagicmethods.py |  2 +-
- mock/tests/testmock.py         | 17 ++++++++++-------
- 2 files changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/mock/tests/testmagicmethods.py b/mock/tests/testmagicmethods.py
-index f47a202..a6c280d 100644
---- a/mock/tests/testmagicmethods.py
-+++ b/mock/tests/testmagicmethods.py
-@@ -405,7 +405,7 @@ class TestMockingMagicMethods(unittest.TestCase):
-         mock = MagicMock()
-         def set_setattr():
-             mock.__setattr__ = lambda self, name: None
--        self.assertRaisesRegex(AttributeError,
-+        six.assertRaisesRegex(self, AttributeError,
-             "Attempting to set unsupported magic method '__setattr__'.",
-             set_setattr
-         )
-diff --git a/mock/tests/testmock.py b/mock/tests/testmock.py
-index 66323e9..e9c5fef 100644
---- a/mock/tests/testmock.py
-+++ b/mock/tests/testmock.py
-@@ -205,7 +205,7 @@ class MockTest(unittest.TestCase):
- 
-         mock = create_autospec(f)
-         mock.side_effect = ValueError('Bazinga!')
--        self.assertRaisesRegex(ValueError, 'Bazinga!', mock)
-+        six.assertRaisesRegex(self, ValueError, 'Bazinga!', mock)
- 
-     @unittest.skipUnless('java' in sys.platform,
-                           'This test only applies to Jython')
-@@ -501,7 +501,8 @@ class MockTest(unittest.TestCase):
- 
-                 # this should be allowed
-                 mock.something
--                self.assertRaisesRegex(
-+                six.assertRaisesRegex(
-+                    self,
-                     AttributeError,
-                     "Mock object has no attribute 'something_else'",
-                     getattr, mock, 'something_else'
-@@ -520,12 +521,14 @@ class MockTest(unittest.TestCase):
-             mock.x
-             mock.y
-             mock.__something__
--            self.assertRaisesRegex(
-+            six.assertRaisesRegex(
-+                self,
-                 AttributeError,
-                 "Mock object has no attribute 'z'",
-                 getattr, mock, 'z'
-             )
--            self.assertRaisesRegex(
-+            six.assertRaisesRegex(
-+                self,
-                 AttributeError,
-                 "Mock object has no attribute '__foobar__'",
-                 getattr, mock, '__foobar__'
-@@ -591,13 +594,13 @@ class MockTest(unittest.TestCase):
- 
-     def test_assert_called_with_message(self):
-         mock = Mock()
--        self.assertRaisesRegex(AssertionError, 'Not called',
-+        six.assertRaisesRegex(self, AssertionError, 'Not called',
-                                 mock.assert_called_with)
- 
- 
-     def test_assert_called_once_with_message(self):
-         mock = Mock(name='geoffrey')
--        self.assertRaisesRegex(AssertionError,
-+        six.assertRaisesRegex(self, AssertionError,
-                      r"Expected 'geoffrey' to be called once\.",
-                      mock.assert_called_once_with)
- 
-@@ -1486,7 +1489,7 @@ class MockTest(unittest.TestCase):
-         second = mopen().readline()
-         self.assertEqual('abc', first)
-         self.assertEqual('abc', second)
-- 
-+
-     def test_mock_parents(self):
-         for Klass in Mock, MagicMock:
-             m = Klass()
--- 
-2.18.0
-

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-05-27 18:54:45 UTC (rev 471805)
+++ PKGBUILD	2019-05-27 18:54:52 UTC (rev 471806)
@@ -3,8 +3,8 @@
 
 pkgbase=python-mock
 pkgname=(python2-mock python-mock)
-pkgver=2.0.0
-pkgrel=4
+pkgver=3.0.5
+pkgrel=1
 pkgdesc='Mocking and Patching Library for Testing'
 url='http://www.voidspace.org.uk/python/mock/'
 makedepends=('python2' 'python' 'python-pbr' 'python2-pbr')
@@ -11,15 +11,11 @@
 checkdepends=('python2-funcsigs')
 license=('BSD')
 arch=('any')
-source=("https://files.pythonhosted.org/packages/source/m/mock/mock-$pkgver.tar.gz"
-        "0001-be-able-to-run-tests-on-python2.patch")
-sha512sums=('a08007651b749d2843b94f5045d74c122958888290aea21930455538a854e6b04c07115e21d82edde996154bf597d7a8784a2f4213cbabc49a98dec22dd92238'
-            '8da4aa25e7f35482369c6e69b4c430b0a506203b5629771cf63932f98d9c4167ed0a08c541baf4993749c24b28cacf0bb26328d34445e7e39448edb89e329f12')
+source=(mock-$pkgver.tar.gz::https://github.com/testing-cabal/mock/archive/$pkgver.tar.gz)
+sha512sums=('9ab4f0c794f5701ba1367d982cf79a5662d4233753d12ed9c88ae20282db1f44be73f84c4d9f6d03ff64926b8c1b6d0c9a79b2a4724a3eb36c247ffd4ab03e2d')
 
 prepare() {
   cd "$srcdir/mock-$pkgver"
-  # self.assertRaisesRegex() is self.assertRaisesRegexp() in Python 2.7
-  patch -p1 -i ../0001-be-able-to-run-tests-on-python2.patch
   # use unittest instead of unittest2 as they are the same on recent python*
   sed -i 's/unittest2/unittest/g' mock/tests/*.py
 
@@ -42,6 +38,8 @@
 
   cd "$srcdir/mock2-$pkgver"
   echo 'python2 tests'
+  # Remove Python 3 only test
+  rm mock/tests/testhelpers_py3.py
   python2 -m unittest discover
 }
 


More information about the arch-commits mailing list