MCPcopy Index your code
hub / github.com/numpy/numpy / test_legacy_pickle

Method test_legacy_pickle

numpy/random/tests/test_direct.py:562–583  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

560 cls.invalid_init_values = [(-1,)]
561
562 def test_legacy_pickle(self):
563 # Pickling format was changed in 2.0.x
564 import gzip
565 import pickle
566
567 expected_state = np.array(
568 [
569 9957867060933711493,
570 532597980065565856,
571 14769588338631205282,
572 13
573 ],
574 dtype=np.uint64
575 )
576
577 base_path = os.path.split(os.path.abspath(__file__))[0]
578 pkl_file = os.path.join(base_path, "data", "sfc64_np126.pkl.gz")
579 with gzip.open(pkl_file) as gz:
580 sfc = pickle.load(gz)
581
582 assert isinstance(sfc, SFC64)
583 assert_equal(sfc.state["state"]["state"], expected_state)
584
585
586class TestDefaultRNG:

Callers

nothing calls this directly

Calls 5

assert_equalFunction · 0.90
splitMethod · 0.80
joinMethod · 0.80
abspathMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected