Skip to content
Snippets Groups Projects
Verified Commit 1a54bf82 authored by David Runge's avatar David Runge :chipmunk:
Browse files

Add upstreamed patch to remove use of python-mock


Signed-off-by: default avatarDavid Runge <dvzrv@archlinux.org>
parent 861a9999
No related branches found
No related tags found
No related merge requests found
......@@ -9,15 +9,22 @@ arch=(any)
url="https://github.com/keleshev/$_name"
depends=(python python-contextlib2)
makedepends=(python-setuptools)
checkdepends=(python-mock python-pytest)
checkdepends=(python-pytest)
license=(MIT)
source=($_name-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz)
sha256sums=('9af94571c6c2df01be002a8dcd5efda33a64b08ce2c7fba9646d2a8fe762c8e3')
source=(
$_name-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz
$pkgname-0.7.5-mock.patch
)
sha256sums=('9af94571c6c2df01be002a8dcd5efda33a64b08ce2c7fba9646d2a8fe762c8e3'
'fa8c47083e9531f6865dfbe61e7f33eddd09b1e40d42cc55b99e3e69a4ce256d')
prepare() {
cd "$srcdir/$_name-$pkgver"
# accept arbitrary versions
sed 's|==|>=|g' -i requirements.txt
# remove the use of python-mock
patch -Np1 -i ../$pkgname-0.7.5-mock.patch
}
build() {
......
From 3baf0c3595ab7bb70f920968400947c117d1564d Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@vdwaa.nl>
Date: Wed, 8 Nov 2023 10:07:25 +0100
Subject: [PATCH] Make mock test dependency optional for Python > 3.3
Since Python 3.3 unittest.mock is available as a build in module.
---
test_schema.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test_schema.py b/test_schema.py
index 370298a..0dbaf88 100644
--- a/test_schema.py
+++ b/test_schema.py
@@ -10,7 +10,10 @@
from functools import partial
from operator import methodcaller
-from mock import Mock
+try:
+ from unittest.mock import Mock
+except ImportError:
+ from mock import Mock
from pytest import mark, raises
from schema import (
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment