1
0

- Modify the py311.patch to fix the test_abort_broken test, instead of

disabling.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-benchmark?expand=0&rev=24
This commit is contained in:
Daniel Garcia 2023-01-17 13:05:08 +00:00 committed by Git OBS Bridge
parent cf4c34bdbf
commit 0f2466043a
3 changed files with 20 additions and 21 deletions

View File

@ -1,17 +1,3 @@
From b2f624afd68a3090f20187a46284904dd4baa4f6 Mon Sep 17 00:00:00 2001
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
Date: Tue, 17 Jan 2023 13:14:42 +0100
Subject: [PATCH] Python 3.11 compatibility
This patch adds the new arguments to the types.CodeType class
constructor in the clonefunc function.
See https://github.com/ionelmc/pytest-benchmark/issues/231
---
src/pytest_benchmark/compat.py | 1 +
src/pytest_benchmark/utils.py | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/pytest_benchmark/compat.py b/src/pytest_benchmark/compat.py
index 63d01bd..9afecf2 100644
--- a/src/pytest_benchmark/compat.py
@ -25,7 +11,7 @@ diff --git a/src/pytest_benchmark/utils.py b/src/pytest_benchmark/utils.py
index c80352a..e28c04e 100644
--- a/src/pytest_benchmark/utils.py
+++ b/src/pytest_benchmark/utils.py
@@ -26,7 +26,7 @@ from urllib.parse import urlparse
@@ -26,7 +26,7 @@
import genericpath
@ -45,6 +31,15 @@ index c80352a..e28c04e 100644
co2 = types.CodeType(*args)
#
# then, we clone the function itself, using the new co2
--
2.39.0
diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py
index 280ce24..964787f 100644
--- a/tests/test_benchmark.py
+++ b/tests/test_benchmark.py
@@ -952,7 +952,6 @@ def result():
" def test_bad(benchmark):",
"? @benchmark",
- "? def result():",
"test_abort_broken.py:*",
"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _*",

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 17 13:03:29 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Modify the py311.patch to fix the test_abort_broken test, instead of
disabling.
-------------------------------------------------------------------
Tue Jan 17 12:44:25 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>

View File

@ -71,9 +71,7 @@ sed -i -e '/test_fast PASSED/d' -e '/test_fast SKIPPED/d' tests/test_benchmark.p
%python_clone -a %{buildroot}%{_bindir}/py.test-benchmark
%check
# gh#ionelmc/pytest-benchmark#231
donttest="test_abort_broken"
%pytest tests -k "not $donttest"
%pytest tests
%post
%{python_install_alternative pytest-benchmark py.test-benchmark}