MCPcopy
hub / github.com/sphinx-doc/sphinx / test_pickleablility

Function test_pickleablility

tests/test_versioning.py:63–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61
62
63def test_pickleablility() -> None:
64 # we have to modify the doctree so we can pickle it
65 copy = original.copy()
66 copy.reporter = None # type: ignore[assignment]
67 copy.transformer = None # type: ignore[assignment]
68 copy.settings.warning_stream = None
69 copy.settings.env = None
70 copy.settings.record_dependencies = DependencyList()
71 loaded = pickle.loads(pickle.dumps(copy, pickle.HIGHEST_PROTOCOL))
72 assert all(getattr(n, 'uid', False) for n in loaded.findall(is_paragraph))
73
74
75def test_modified() -> None:

Callers

nothing calls this directly

Calls 4

dumpsMethod · 0.80
copyMethod · 0.45
loadsMethod · 0.45
findallMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…