mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-24 11:37:20 -08:00
dev-python/tblib: Enable pypy3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
diff --git a/tests/test_pickle_exception.py b/tests/test_pickle_exception.py
|
||||
index 5ff4679..53a9dce 100644
|
||||
--- a/tests/test_pickle_exception.py
|
||||
+++ b/tests/test_pickle_exception.py
|
||||
@@ -29,6 +29,10 @@ class CustomError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
+def strip_locations(tb_text):
|
||||
+ return tb_text.replace(' ~~^~~\n', '').replace(' ^^^^^^^^^^^^^^^^^\n', '')
|
||||
+
|
||||
+
|
||||
@pytest.mark.parametrize('protocol', [None, *list(range(1, pickle.HIGHEST_PROTOCOL + 1))])
|
||||
@pytest.mark.parametrize('how', ['global', 'instance', 'class'])
|
||||
def test_install(clear_dispatch_table, how, protocol):
|
||||
@@ -58,8 +62,8 @@ def test_install(clear_dispatch_table, how, protocol):
|
||||
else:
|
||||
raise AssertionError
|
||||
|
||||
- expected_format_exception = ''.join(format_exception(type(exc), exc, exc.__traceback__))
|
||||
- print(expected_format_exception)
|
||||
+ expected_format_exception = strip_locations(''.join(format_exception(type(exc), exc, exc.__traceback__)))
|
||||
+
|
||||
# Populate Exception.__dict__, which is used in some cases
|
||||
exc.x = 1
|
||||
exc.__cause__.x = 2
|
||||
@@ -88,7 +92,7 @@ def test_install(clear_dispatch_table, how, protocol):
|
||||
if has_python311:
|
||||
assert exc.__notes__ == ['note 1', 'note 2']
|
||||
|
||||
- assert expected_format_exception == ''.join(format_exception(type(exc), exc, exc.__traceback__))
|
||||
+ assert expected_format_exception == strip_locations(''.join(format_exception(type(exc), exc, exc.__traceback__)))
|
||||
|
||||
|
||||
@tblib.pickling_support.install
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{10..13} pypy3 )
|
||||
PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 )
|
||||
|
||||
inherit distutils-r1 pypi
|
||||
|
||||
@@ -29,6 +29,11 @@ BDEPEND="
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
PATCHES=(
|
||||
# combined fixes from https://github.com/ionelmc/python-tblib/issues/74
|
||||
"${FILESDIR}/${P}-test.patch"
|
||||
)
|
||||
|
||||
python_test() {
|
||||
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
|
||||
local -x PYTHONNODEBUGRANGES=yes
|
||||
|
||||
Reference in New Issue
Block a user