Skip to content

Commit 6da726a

Browse files
authored
Fix pickle hash test for Python 3.14 (#725)
1 parent 5928617 commit 6da726a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ chronological order. Releases follow [semantic versioning](https://semver.org/)
55
releases are available on [PyPI](https://pypi.org/project/pytask) and
66
[Anaconda.org](https://anaconda.org/conda-forge/pytask).
77

8+
## Unreleased
9+
10+
- {pull}`725` fixes the pickle node hash test by accounting for Python 3.14's
11+
default pickle protocol.
12+
813
## 0.5.7 - 2025-11-22
914

1015
- {pull}`721` clarifies the documentation on repeated tasks in notebooks.

tests/test_nodes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pickle
4+
import sys
45
from pathlib import Path
56

67
import cloudpickle
@@ -94,7 +95,15 @@ def test_hash_of_path_node(tmp_path, value, exists, expected):
9495
("value", "exists", "expected"),
9596
[
9697
("0", False, None),
97-
("0", True, "2e81f502b7a28f824c4f1451c946b952eebe65a8521925ef8f6135ef6f422e8e"),
98+
# Python 3.14+ uses pickle protocol 5 by default, which produces different
99+
# hashes
100+
(
101+
"0",
102+
True,
103+
"1973e23848344dc43a988a9b478663803cfffe1243480253f9a3cf004b14aa7c"
104+
if sys.version_info >= (3, 14)
105+
else "2e81f502b7a28f824c4f1451c946b952eebe65a8521925ef8f6135ef6f422e8e",
106+
),
98107
],
99108
)
100109
def test_hash_of_pickle_node(tmp_path, value, exists, expected):

0 commit comments

Comments
 (0)