mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
[ci skip] Response to question by gh-henryiii (https://github.com/pybind/pybind11/pull/5580#discussion_r2019137216) (#5591)
This commit is contained in:
committed by
GitHub
parent
8726ed22d8
commit
a34fcdc48d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user