[arch-commits] Commit in python-doublex/trunk (PKGBUILD python37-async.patch)

Evangelos Foutras foutrelis at archlinux.org
Wed Jul 18 04:29:48 UTC 2018


    Date: Wednesday, July 18, 2018 @ 04:29:48
  Author: foutrelis
Revision: 361706

upgpkg: python-doublex 1.8.4-4

Temporarily rename "async" method to "wait" until there is an upstream fix.

https://github.com/davidvilla/python-doublex/issues/7

Added:
  python-doublex/trunk/python37-async.patch
Modified:
  python-doublex/trunk/PKGBUILD

----------------------+
 PKGBUILD             |   10 +++++--
 python37-async.patch |   63 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-07-18 04:29:21 UTC (rev 361705)
+++ PKGBUILD	2018-07-18 04:29:48 UTC (rev 361706)
@@ -4,7 +4,7 @@
 pkgbase=python-doublex
 pkgname=('python-doublex' 'python2-doublex')
 pkgver=1.8.4
-pkgrel=3
+pkgrel=4
 pkgdesc="Powerful test doubles framework for Python"
 arch=('any')
 license=('GPL')
@@ -11,10 +11,14 @@
 url="https://github.com/davidvilla/python-doublex"
 makedepends=('python-setuptools' 'python2-setuptools' 'python-pyhamcrest' 'python2-pyhamcrest' 'git')
 checkdepends=('python-nose' 'python2-nose')
-source=("git+https://github.com/davidvilla/python-doublex.git#tag=v$pkgver")
-sha512sums=('SKIP')
+source=("git+https://github.com/davidvilla/python-doublex.git#tag=v$pkgver"
+        python37-async.patch)
+sha512sums=('SKIP'
+            'a2b61482cf0925b3d01cbfaa959297a1c9e52106f017a4685c61e3f8c952b131eff0e11b6fe3c8444083230be561d30b7e6647c555c602ef0c66eebda9b06811')
 
 prepare() {
+  # https://github.com/davidvilla/python-doublex/issues/7
+  patch -d python-doublex -Np1 < python37-async.patch
   cp -a python-doublex{,-py2}
 }
 

Added: python37-async.patch
===================================================================
--- python37-async.patch	                        (rev 0)
+++ python37-async.patch	2018-07-18 04:29:48 UTC (rev 361706)
@@ -0,0 +1,63 @@
+diff --git a/doublex/matchers.py b/doublex/matchers.py
+index e6ccf3c..2ecc987 100644
+--- a/doublex/matchers.py
++++ b/doublex/matchers.py
+@@ -97,7 +97,7 @@ class MethodCalled(OperationMatcher):
+ 
+         if self._async_timeout:
+             if self._times != any_time:
+-                raise WrongApiUsage("'times' and 'async' are exclusive")
++                raise WrongApiUsage("'times' and 'wait' are exclusive")
+             self.method._event.wait(self._async_timeout)
+ 
+         return method._was_called(self.context, self._times)
+@@ -126,7 +126,7 @@ class MethodCalled(OperationMatcher):
+         self.context.check_some_args = True
+         return self
+ 
+-    def async(self, timeout):
++    def wait(self, timeout):
+         self._async_timeout = timeout
+         return self
+ 
+diff --git a/doublex/test/async_race_condition_test.py b/doublex/test/async_race_condition_test.py
+index c16e3a3..375a5cf 100644
+--- a/doublex/test/async_race_condition_test.py
++++ b/doublex/test/async_race_condition_test.py
+@@ -36,4 +36,4 @@ class AsyncTests(unittest.TestCase):
+         sut.some_method()
+ 
+         # then
+-        assert_that(spy.write, called().async(1))
++        assert_that(spy.write, called().wait(1))
+diff --git a/doublex/test/unit_tests.py b/doublex/test/unit_tests.py
+index d1e1b6d..378fe94 100644
+--- a/doublex/test/unit_tests.py
++++ b/doublex/test/unit_tests.py
+@@ -1340,7 +1340,7 @@ class AsyncTests(TestCase):
+         sut.send_data()
+ 
+         # then
+-        assert_that(spy.write, called().async(timeout=1))
++        assert_that(spy.write, called().wait(timeout=1))
+ 
+     def test_spy_async_support_1_call_only(self):
+         # given
+@@ -1353,7 +1353,7 @@ class AsyncTests(TestCase):
+ 
+         # then
+         with self.assertRaises(WrongApiUsage):
+-            assert_that(spy.write, called().async(timeout=1).with_args(3).times(2))
++            assert_that(spy.write, called().wait(timeout=1).with_args(3).times(2))
+ 
+     def test_spy_async_stubbed(self):
+         # given
+@@ -1366,7 +1366,7 @@ class AsyncTests(TestCase):
+         sut.send_data(3)
+ 
+         # then
+-        assert_that(spy.write, called().async(timeout=1))
++        assert_that(spy.write, called().wait(timeout=1))
+ 
+ 
+ # new on 1.7



More information about the arch-commits mailing list