-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
b3a5156
commit e9e42a1
Showing
5 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
diff --git a/src/pytest_benchmark/compat.py b/src/pytest_benchmark/compat.py | ||
index 63d01bd..9afecf2 100644 | ||
--- a/src/pytest_benchmark/compat.py | ||
+++ b/src/pytest_benchmark/compat.py | ||
@@ -1,3 +1,4 @@ | ||
import sys | ||
|
||
PY38 = sys.version_info[0] == 3 and sys.version_info[1] >= 8 | ||
+PY311 = sys.version_info[0] == 3 and sys.version_info[1] >= 11 | ||
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 @@ | ||
|
||
import genericpath | ||
|
||
-from .compat import PY38 | ||
+from .compat import PY38, PY311 | ||
|
||
# This is here (in the utils module) because it might be used by | ||
# various other modules. | ||
@@ -521,6 +521,10 @@ def clonefunc(f): | ||
co.co_firstlineno, co.co_lnotab, co.co_freevars, co.co_cellvars] | ||
if PY38: | ||
args.insert(1, co.co_posonlyargcount) | ||
+ | ||
+ if PY311: | ||
+ args.insert(12, co.co_qualname) | ||
+ args.insert(15, co.co_exceptiontable) | ||
co2 = types.CodeType(*args) | ||
# | ||
# then, we clone the function itself, using the new co2 | ||
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:*", | ||
"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _*", |
15 changes: 15 additions & 0 deletions
15
packages/p/python-pytest-benchmark/python-pytest-benchmark.changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
------------------------------------------------------------------- | ||
Tue Jan 17 13:03:29 UTC 2023 - Daniel Garcia <[email protected]> | ||
|
||
- Modify the py311.patch to fix the test_abort_broken test, instead of | ||
disabling. | ||
|
||
------------------------------------------------------------------- | ||
Tue Jan 17 12:44:25 UTC 2023 - Daniel Garcia <[email protected]> | ||
|
||
- 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. | ||
|
||
------------------------------------------------------------------- | ||
Wed Nov 30 07:44:51 UTC 2022 - Daniel Garcia <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters