python-cloudpickle/Fix-test_extract_class_dict-for-Python-313.patch
Markéta Machová 70dc196ad9 - Update to 3.1.0
* Some improvements to make cloudpickle more deterministic when
    pickling dynamic functions and classes, in particular with
    CPython 3.13. (PR #524 and PR #534)
  * Fix a problem with the joint usage of cloudpickle's
    _whichmodule and multiprocessing. (PR #529)
- Drop Fix-test_extract_class_dict-for-Python-313.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cloudpickle?expand=0&rev=58
2024-11-27 09:06:08 +00:00

19 lines
783 B
Diff

diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py
index 5aa4bac..af5ef3e 100644
--- a/tests/cloudpickle_test.py
+++ b/tests/cloudpickle_test.py
@@ -110,7 +110,12 @@ def test_extract_class_dict():
return "c"
clsdict = _extract_class_dict(C)
- assert sorted(clsdict.keys()) == ["C_CONSTANT", "__doc__", "method_c"]
+ expected_keys = ["C_CONSTANT", "__doc__", "method_c"]
+ # New attribute in Python 3.13 beta 1
+ # https://github.com/python/cpython/pull/118475
+ if sys.version_info >= (3, 13):
+ expected_keys.insert(2, "__firstlineno__")
+ assert sorted(clsdict.keys()) == expected_keys
assert clsdict["C_CONSTANT"] == 43
assert clsdict["__doc__"] is None
assert clsdict["method_c"](C()) == C().method_c()