MCPcopy Index your code
hub / github.com/pydata/xarray / test_file_manager_write_pickle

Function test_file_manager_write_pickle

xarray/tests/test_backends_file_manager.py:210–223  ·  view source on GitHub ↗
(tmpdir, file_cache)

Source from the content-addressed store, hash-verified

208
209
210def test_file_manager_write_pickle(tmpdir, file_cache) -> None:
211 path = str(tmpdir.join("testing.txt"))
212 manager = CachingFileManager(open, path, mode="w", cache=file_cache)
213 f = manager.acquire()
214 f.write("foo")
215 f.flush()
216 manager2 = pickle.loads(pickle.dumps(manager))
217 f2 = manager2.acquire()
218 f2.write("bar")
219 manager2.close()
220 manager.close()
221
222 with open(path) as f:
223 assert f.read() == "foobar"
224
225
226def test_file_manager_read(tmpdir, file_cache) -> None:

Callers

nothing calls this directly

Calls 7

acquireMethod · 0.95
closeMethod · 0.95
CachingFileManagerClass · 0.90
readMethod · 0.80
joinMethod · 0.45
acquireMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…