From a34fcdc48da2a2092075d98eeea96aad2bb81f96 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 30 Mar 2025 19:56:07 -0700 Subject: [PATCH] [ci skip] Response to question by gh-henryiii (https://github.com/pybind/pybind11/pull/5580#discussion_r2019137216) (#5591) --- tests/test_pickling.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_pickling.py b/tests/test_pickling.py index c3b5c6327..98381d9bd 100644 --- a/tests/test_pickling.py +++ b/tests/test_pickling.py @@ -9,11 +9,12 @@ import env from pybind11_tests import pickling as m -def test_assumptions(): +def all_pickle_protocols(): assert pickle.HIGHEST_PROTOCOL >= 0 + return range(pickle.HIGHEST_PROTOCOL + 1) -@pytest.mark.parametrize("protocol", range(pickle.HIGHEST_PROTOCOL + 1)) +@pytest.mark.parametrize("protocol", all_pickle_protocols()) def test_pickle_simple_callable(protocol): assert m.simple_callable() == 20220426 serialized = pickle.dumps(m.simple_callable, protocol=protocol)