Skip to content

Commit e9e42a1

Browse files
dgarciabmwiedemann
authored andcommitted
Update python-pytest-benchmark to version 4.0.0 / rev 10 via SR 1059005
https://build.opensuse.org/request/show/1059005 by user dgarcia + dimstar_suse - Modify the py311.patch to fix the test_abort_broken test, instead of disabling. - Add py311.patch to make it compatible with python 3.11, gh#ionelmc/pytest-benchmark#232 - Disable broken test_abort_broken, this test is broken because the output of the tests is a bit different with python 3.11 so we can disable until it's fixed.
1 parent b3a5156 commit e9e42a1

File tree

5 files changed

+78
-1
lines changed

5 files changed

+78
-1
lines changed
49 Bytes
Binary file not shown.

packages/p/python-pytest-benchmark/.rev

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,19 @@
108108
</comment>
109109
<requestid>1039055</requestid>
110110
</revision>
111+
<revision rev="10" vrev="2">
112+
<srcmd5>fa04fdaa9cf3bda88f1db9a99d762c6c</srcmd5>
113+
<version>4.0.0</version>
114+
<time>1674043711</time>
115+
<user>dimstar_suse</user>
116+
<comment>- Modify the py311.patch to fix the test_abort_broken test, instead of
117+
disabling.
118+
- Add py311.patch to make it compatible with python 3.11,
119+
gh#ionelmc/pytest-benchmark#232
120+
- Disable broken test_abort_broken, this test is broken because the output of
121+
the tests is a bit different with python 3.11 so we can disable until it's
122+
fixed.
123+
</comment>
124+
<requestid>1059005</requestid>
125+
</revision>
111126
</revisionlist>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/src/pytest_benchmark/compat.py b/src/pytest_benchmark/compat.py
2+
index 63d01bd..9afecf2 100644
3+
--- a/src/pytest_benchmark/compat.py
4+
+++ b/src/pytest_benchmark/compat.py
5+
@@ -1,3 +1,4 @@
6+
import sys
7+
8+
PY38 = sys.version_info[0] == 3 and sys.version_info[1] >= 8
9+
+PY311 = sys.version_info[0] == 3 and sys.version_info[1] >= 11
10+
diff --git a/src/pytest_benchmark/utils.py b/src/pytest_benchmark/utils.py
11+
index c80352a..e28c04e 100644
12+
--- a/src/pytest_benchmark/utils.py
13+
+++ b/src/pytest_benchmark/utils.py
14+
@@ -26,7 +26,7 @@
15+
16+
import genericpath
17+
18+
-from .compat import PY38
19+
+from .compat import PY38, PY311
20+
21+
# This is here (in the utils module) because it might be used by
22+
# various other modules.
23+
@@ -521,6 +521,10 @@ def clonefunc(f):
24+
co.co_firstlineno, co.co_lnotab, co.co_freevars, co.co_cellvars]
25+
if PY38:
26+
args.insert(1, co.co_posonlyargcount)
27+
+
28+
+ if PY311:
29+
+ args.insert(12, co.co_qualname)
30+
+ args.insert(15, co.co_exceptiontable)
31+
co2 = types.CodeType(*args)
32+
#
33+
# then, we clone the function itself, using the new co2
34+
diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py
35+
index 280ce24..964787f 100644
36+
--- a/tests/test_benchmark.py
37+
+++ b/tests/test_benchmark.py
38+
@@ -952,7 +952,6 @@ def result():
39+
40+
" def test_bad(benchmark):",
41+
"? @benchmark",
42+
- "? def result():",
43+
44+
"test_abort_broken.py:*",
45+
"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _*",

packages/p/python-pytest-benchmark/python-pytest-benchmark.changes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
-------------------------------------------------------------------
2+
Tue Jan 17 13:03:29 UTC 2023 - Daniel Garcia <[email protected]>
3+
4+
- Modify the py311.patch to fix the test_abort_broken test, instead of
5+
disabling.
6+
7+
-------------------------------------------------------------------
8+
Tue Jan 17 12:44:25 UTC 2023 - Daniel Garcia <[email protected]>
9+
10+
- Add py311.patch to make it compatible with python 3.11,
11+
gh#ionelmc/pytest-benchmark#232
12+
- Disable broken test_abort_broken, this test is broken because the output of
13+
the tests is a bit different with python 3.11 so we can disable until it's
14+
fixed.
15+
116
-------------------------------------------------------------------
217
Wed Nov 30 07:44:51 UTC 2022 - Daniel Garcia <[email protected]>
318

packages/p/python-pytest-benchmark/python-pytest-benchmark.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# spec file for package python-pytest-benchmark
33
#
4-
# Copyright (c) 2022 SUSE LLC
4+
# Copyright (c) 2023 SUSE LLC
55
#
66
# All modifications and additions to the file contributed by third parties
77
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ License: BSD-2-Clause
2525
URL: https://github.com/ionelmc/pytest-benchmark
2626
Source: https://files.pythonhosted.org/packages/source/p/pytest-benchmark/pytest-benchmark-%{version}.tar.gz
2727
Patch0: fix-test-fast.patch
28+
# PATCH-FIX-OPENSUSE py311.patch gh#ionelmc/pytest-benchmark#232
29+
Patch1: py311.patch
2830
BuildRequires: %{python_module aspectlib}
2931
BuildRequires: %{python_module elasticsearch}
3032
BuildRequires: %{python_module freezegun}

0 commit comments

Comments
 (0)