mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/requests-oauthlib: Enable py3.15
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
From b1dd93c5d024500b6236dea06734d6e6482c3565 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Huot <jonathan.huot@gmail.com>
|
||||
Date: Thu, 12 Jun 2025 20:06:32 +0200
|
||||
Subject: [PATCH] Updated tests to support 3.3.0/changes rel. to expires_at
|
||||
|
||||
---
|
||||
tests/test_compliance_fixes.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/test_compliance_fixes.py b/tests/test_compliance_fixes.py
|
||||
index c5166bd..9ad6d09 100644
|
||||
--- a/tests/test_compliance_fixes.py
|
||||
+++ b/tests/test_compliance_fixes.py
|
||||
@@ -115,7 +115,7 @@ def test_fetch_access_token(self):
|
||||
authorization_response="https://i.b/?code=hello",
|
||||
)
|
||||
# Times should be close
|
||||
- approx_expires_at = time.time() + 3600
|
||||
+ approx_expires_at = round(time.time()) + 3600
|
||||
actual_expires_at = token.pop("expires_at")
|
||||
self.assertAlmostEqual(actual_expires_at, approx_expires_at, places=2)
|
||||
|
||||
@@ -289,7 +289,7 @@ def test_fetch_access_token(self):
|
||||
authorization_response="https://i.b/?code=hello",
|
||||
)
|
||||
|
||||
- approx_expires_at = time.time() + 86400
|
||||
+ approx_expires_at = round(time.time()) + 86400
|
||||
actual_expires_at = token.pop("expires_at")
|
||||
self.assertAlmostEqual(actual_expires_at, approx_expires_at, places=2)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{11..14} )
|
||||
PYTHON_COMPAT=( python3_{12..15} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
@@ -26,25 +26,21 @@ RDEPEND="
|
||||
>=dev-python/requests-2.0.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/oauthlib-3.0.0[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND="
|
||||
test? (
|
||||
dev-python/requests-mock[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
EPYTEST_PLUGINS=( requests-mock )
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_test() {
|
||||
local EPYTEST_DESELECT=(
|
||||
# Internet access
|
||||
tests/test_core.py::OAuth1Test::testCanPostBinaryData
|
||||
tests/test_core.py::OAuth1Test::test_content_type_override
|
||||
tests/test_core.py::OAuth1Test::test_url_is_native_str
|
||||
)
|
||||
local EPYTEST_IGNORE=(
|
||||
tests/examples
|
||||
)
|
||||
PATCHES=(
|
||||
# https://github.com/requests/requests-oauthlib/commit/b1dd93c5d024500b6236dea06734d6e6482c3565
|
||||
"${FILESDIR}/${P}-test.patch"
|
||||
)
|
||||
|
||||
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
|
||||
epytest
|
||||
}
|
||||
EPYTEST_DESELECT=(
|
||||
# Internet access
|
||||
tests/test_core.py::OAuth1Test::testCanPostBinaryData
|
||||
tests/test_core.py::OAuth1Test::test_content_type_override
|
||||
tests/test_core.py::OAuth1Test::test_url_is_native_str
|
||||
)
|
||||
EPYTEST_IGNORE=(
|
||||
tests/examples
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user