MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_failed_symlink

Method test_failed_symlink

Lib/test/test_venv.py:595–606  ·  view source on GitHub ↗

Test handling of failed symlinks on Windows.

(self)

Source from the content-addressed store, hash-verified

593 @unittest.skipUnless(os.name == 'nt' and can_symlink(),
594 'symlinks on Windows')
595 def test_failed_symlink(self):
596 """
597 Test handling of failed symlinks on Windows.
598 """
599 rmtree(self.env_dir)
600 env_dir = os.path.join(os.path.realpath(self.env_dir), 'venv')
601 with patch('os.symlink') as mock_symlink:
602 mock_symlink.side_effect = OSError()
603 builder = venv.EnvBuilder(clear=True, symlinks=True)
604 _, err = self.run_with_capture(builder.create, env_dir)
605 filepath_regex = r"'[A-Z]:\\\\(?:[^\\\\]+\\\\)*[^\\\\]+'"
606 self.assertRegex(err, rf"Unable to symlink {filepath_regex} to {filepath_regex}")
607
608 @requireVenvCreate
609 def test_multiprocessing(self):

Callers

nothing calls this directly

Calls 6

rmtreeFunction · 0.90
patchFunction · 0.90
realpathMethod · 0.80
run_with_captureMethod · 0.80
assertRegexMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected