Skip to content

Commit

Permalink
Fix test_extract_class_dict for Python 3.13 beta 1
Browse files Browse the repository at this point in the history
Resolves: #533
  • Loading branch information
frenzymadness committed May 15, 2024
1 parent f111f7a commit 3c300a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/cloudpickle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ def method_c(self):
return "c"

clsdict = _extract_class_dict(C)
assert list(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 list(clsdict.keys()) == expected_keys
assert clsdict["C_CONSTANT"] == 43
assert clsdict["__doc__"] is None
assert clsdict["method_c"](C()) == C().method_c()
Expand Down

0 comments on commit 3c300a0

Please sign in to comment.