* update python-requests-mock to 1.10.0-3

This commit is contained in:
Alexander Baldeck 2023-07-28 13:17:56 +02:00
parent fc86abbd4e
commit a2057a27b8
2 changed files with 48 additions and 4 deletions

View File

@ -3,20 +3,27 @@
pkgname=python-requests-mock
pkgver=1.10.0
pkgrel=2
pkgrel=3
pkgdesc="A mock of useful classes and functions to be used with python-requests."
arch=(any)
url="https://github.com/jamielennox/requests-mock"
license=('Apache')
depends=('python-requests' 'python-six')
makedepends=('python-pbr')
checkdepends=('python-mock' 'python-purl' 'python-pytest' 'python-requests-futures'
checkdepends=('python-purl' 'python-pytest' 'python-requests-futures'
'python-testrepository')
source=("$pkgname-$pkgver.tar.gz::https://github.com/jamielennox/requests-mock/archive/$pkgver.tar.gz")
sha512sums=('24e34407651a14d89ce24b4fcd32556d7a522c02a3855466c6523c45e88dbc751d560478cc9af1eafc903dc8fdfc8715e1effedd116e33dee96063c980050560')
source=("$pkgname-$pkgver.tar.gz::https://github.com/jamielennox/requests-mock/archive/$pkgver.tar.gz"
"stop-using-python-mock.patch")
sha512sums=('24e34407651a14d89ce24b4fcd32556d7a522c02a3855466c6523c45e88dbc751d560478cc9af1eafc903dc8fdfc8715e1effedd116e33dee96063c980050560'
'd3616feea24bd17c000664fa809098609376c5220859217b3c0caa193804511d76275d40164f8905f0a863f6634375c7e022464016f6fe64a4124030f4df9307')
export PBR_VERSION=$pkgver
prepare() {
cd requests-mock-$pkgver
patch -Np1 -i ${srcdir}/stop-using-python-mock.patch
}
build() {
cd requests-mock-$pkgver
python setup.py build

View File

@ -0,0 +1,37 @@
From f32872b3c102e7c30aaed78b128ddf8d6ef448c1 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@archlinux.org>
Date: Sat, 20 May 2023 14:41:18 +0200
Subject: [PATCH] Use unittest.mock when available on Python > 3.3
---
test-requirements.txt | 2 +-
tests/test_mocker.py | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/test-requirements.txt b/test-requirements.txt
index 9df4c10..cdab309 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,5 +1,5 @@
fixtures
-mock
+mock; python_version < '3.3'
purl
pytest
sphinx
diff --git a/tests/test_mocker.py b/tests/test_mocker.py
index 8d015cd..7eff649 100644
--- a/tests/test_mocker.py
+++ b/tests/test_mocker.py
@@ -13,7 +13,10 @@
import json
import pickle
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import requests
import requests_mock