aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py3-cachy
diff options
context:
space:
mode:
Diffstat (limited to 'testing/py3-cachy')
-rw-r--r--testing/py3-cachy/APKBUILD6
-rw-r--r--testing/py3-cachy/No-need-to-teardown-flexmock.patch148
2 files changed, 152 insertions, 2 deletions
diff --git a/testing/py3-cachy/APKBUILD b/testing/py3-cachy/APKBUILD
index 897f7658f6..3878b22f26 100644
--- a/testing/py3-cachy/APKBUILD
+++ b/testing/py3-cachy/APKBUILD
@@ -4,7 +4,7 @@
pkgname=py3-cachy
_realname=cachy
pkgver=0.3.0
-pkgrel=3
+pkgrel=4
pkgdesc="Simple yet effective caching library"
url="https://github.com/sdispater/cachy"
arch="noarch"
@@ -12,7 +12,8 @@ license="MIT"
depends="python3"
makedepends="pyproject2setuppy"
checkdepends="py3-pytest py3-flexmock py3-fakeredis"
-source="https://files.pythonhosted.org/packages/source/${_realname:0:1}/$_realname/$_realname-$pkgver.tar.gz"
+source="https://files.pythonhosted.org/packages/source/${_realname:0:1}/$_realname/$_realname-$pkgver.tar.gz
+ No-need-to-teardown-flexmock.patch"
builddir="$srcdir/$_realname-$pkgver"
prepare() {
@@ -40,4 +41,5 @@ package() {
sha512sums="
0b69bd45ce81fc57710b44011965b8c4a313808f7c464a409b839d9206158f91b1e39a760d08d62bb5eb15e455ba9b89683f0eb42d2bfcc2e99b0b8f267e3ead cachy-0.3.0.tar.gz
+f6bfa0c013e7f2ed1b386ac5f9d5687a34ffaf7c98bddc2bae80e4c0b008b01511d8658e1244aa93484ad008b671a590c064c88005f06fcc23067b8ea4dbd176 No-need-to-teardown-flexmock.patch
"
diff --git a/testing/py3-cachy/No-need-to-teardown-flexmock.patch b/testing/py3-cachy/No-need-to-teardown-flexmock.patch
new file mode 100644
index 0000000000..72305fa7b1
--- /dev/null
+++ b/testing/py3-cachy/No-need-to-teardown-flexmock.patch
@@ -0,0 +1,148 @@
+From d6fd558be00e3818d01bd1f6a5290bd094a87e52 Mon Sep 17 00:00:00 2001
+From: Stefano Rivera <stefano@rivera.za.net>
+Date: Tue, 9 Nov 2021 23:09:46 -0800
+Subject: [PATCH] No need to teardown flexmock
+
+flexmock patches unittest to hook tearing down, itself.
+
+The flexmock_teardown() function is a private API that was moved in
+0.11.0.
+---
+ tests/stores/test_dict_store.py | 5 +----
+ tests/stores/test_file_store.py | 4 +---
+ tests/stores/test_redis_store.py | 2 --
+ tests/test_cache_manager.py | 5 +----
+ tests/test_repository.py | 5 +----
+ tests/test_tagged_cache.py | 5 +----
+ 6 files changed, 5 insertions(+), 21 deletions(-)
+
+diff --git a/tests/stores/test_dict_store.py b/tests/stores/test_dict_store.py
+index b2574a3..8d4171f 100644
+--- a/tests/stores/test_dict_store.py
++++ b/tests/stores/test_dict_store.py
+@@ -1,16 +1,13 @@
+ # -*- coding: utf-8 -*-
+
+ from unittest import TestCase
+-from flexmock import flexmock, flexmock_teardown
++from flexmock import flexmock
+
+ from cachy.stores import DictStore
+
+
+ class DictStoreTestCase(TestCase):
+
+- def tearDown(self):
+- flexmock_teardown()
+-
+ def test_items_can_be_set_and_retrieved(self):
+ store = DictStore()
+ store.put('foo', 'bar', 10)
+diff --git a/tests/stores/test_file_store.py b/tests/stores/test_file_store.py
+index 10ab336..704612d 100644
+--- a/tests/stores/test_file_store.py
++++ b/tests/stores/test_file_store.py
+@@ -7,7 +7,7 @@
+ import shutil
+
+ from unittest import TestCase
+-from flexmock import flexmock, flexmock_teardown
++from flexmock import flexmock
+
+ from cachy.serializers import JsonSerializer
+ from cachy.stores import FileStore
+@@ -29,8 +29,6 @@ def tearDown(self):
+ if os.path.isdir(e):
+ shutil.rmtree(e)
+
+- flexmock_teardown()
+-
+ def test_none_is_returned_if_file_doesnt_exist(self):
+ mock = flexmock(os.path)
+ mock.should_receive('exists').once().and_return(False)
+diff --git a/tests/stores/test_redis_store.py b/tests/stores/test_redis_store.py
+index a5009f4..82e1fb4 100644
+--- a/tests/stores/test_redis_store.py
++++ b/tests/stores/test_redis_store.py
+@@ -4,7 +4,6 @@
+
+ import redis
+ from unittest import TestCase
+-from flexmock import flexmock, flexmock_teardown
+ from fakeredis import FakeServer
+ from fakeredis import FakeStrictRedis
+ from cachy.stores import RedisStore
+@@ -23,7 +22,6 @@ def setUp(self):
+ super(RedisStoreTestCase, self).setUp()
+
+ def tearDown(self):
+- flexmock_teardown()
+ self.redis.flushdb()
+
+ def test_get_returns_null_when_not_found(self):
+diff --git a/tests/test_cache_manager.py b/tests/test_cache_manager.py
+index ae9dda4..b5da411 100644
+--- a/tests/test_cache_manager.py
++++ b/tests/test_cache_manager.py
+@@ -3,7 +3,7 @@
+ import os
+ import tempfile
+ from unittest import TestCase
+-from flexmock import flexmock, flexmock_teardown
++from flexmock import flexmock
+
+ from cachy import CacheManager, Repository
+ from cachy.stores import DictStore, FileStore
+@@ -12,9 +12,6 @@
+
+ class RepositoryTestCase(TestCase):
+
+- def tearDown(self):
+- flexmock_teardown()
+-
+ def test_store_get_the_correct_store(self):
+ cache = CacheManager({
+ 'default': 'dict',
+diff --git a/tests/test_repository.py b/tests/test_repository.py
+index aeb53b7..f7b3bf5 100644
+--- a/tests/test_repository.py
++++ b/tests/test_repository.py
+@@ -2,7 +2,7 @@
+
+ import datetime
+ from unittest import TestCase
+-from flexmock import flexmock, flexmock_teardown
++from flexmock import flexmock
+
+ from cachy import Repository
+ from cachy.contracts.store import Store
+@@ -10,9 +10,6 @@
+
+ class RepositoryTestCase(TestCase):
+
+- def tearDown(self):
+- flexmock_teardown()
+-
+ def test_get_returns_value_from_cache(self):
+ repo = self._get_repository()
+ repo.get_store().should_receive('get').once().with_args('foo').and_return('bar')
+diff --git a/tests/test_tagged_cache.py b/tests/test_tagged_cache.py
+index cefdc69..79e986c 100644
+--- a/tests/test_tagged_cache.py
++++ b/tests/test_tagged_cache.py
+@@ -7,14 +7,11 @@
+ from cachy.tag_set import TagSet
+ from cachy.redis_tagged_cache import RedisTaggedCache
+ from datetime import datetime, timedelta
+-from flexmock import flexmock, flexmock_teardown
++from flexmock import flexmock
+
+
+ class TaggedCacheTestCase(TestCase):
+
+- def tearDown(self):
+- flexmock_teardown()
+-
+ def test_tags_can_be_flushed(self):
+ store = DictStore()
+