MCPcopy Index your code
hub / github.com/python/cpython / test_exception_on_first_call

Method test_exception_on_first_call

Lib/test/test_shutil.py:3251–3259  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3249 shutil.copyfile, TESTFN, TESTFN2)
3250
3251 def test_exception_on_first_call(self):
3252 # Emulate a case where the first call to the zero-copy
3253 # function raises an exception in which case the function is
3254 # supposed to give up immediately.
3255 with unittest.mock.patch(self.PATCHPOINT,
3256 side_effect=OSError(errno.EINVAL, "yo")):
3257 with self.get_files() as (src, dst):
3258 with self.assertRaises(_GiveupOnFastCopy):
3259 self.zerocopy_fun(src, dst)
3260
3261 def test_filesystem_full(self):
3262 # Emulate a case where filesystem is full and sendfile() fails

Callers

nothing calls this directly

Calls 3

get_filesMethod · 0.95
zerocopy_funMethod · 0.95
assertRaisesMethod · 0.45

Tested by

no test coverage detected