MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / test_closed_file

Method test_closed_file

tests/cloudpickle_file_test.py:32–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30 os.remove(self.tmpfilepath)
31
32 def test_closed_file(self):
33 # Write & close
34 with open(self.tmpfilepath, "w") as f:
35 f.write(self.teststring)
36 with pytest.raises(pickle.PicklingError) as excinfo:
37 cloudpickle.dumps(f)
38 assert "Cannot pickle closed files" in str(excinfo.value)
39 os.remove(self.tmpfilepath)
40
41 def test_r_mode(self):
42 # Write & close

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected