From: Zsolt Dollenstein Date: Fri, 1 Jun 2018 21:47:07 +0000 (+0200) Subject: Skip symlink test if can't create one (#287) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/ef903ecd4688dbc9fc1166caf837420aa2ffdbac Skip symlink test if can't create one (#287) --- diff --git a/tests/test_black.py b/tests/test_black.py index 08a3f31..7e50c2f 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -731,7 +731,10 @@ class BlackTestCase(unittest.TestCase): def test_broken_symlink(self) -> None: with cache_dir() as workspace: symlink = workspace / "broken_link.py" - symlink.symlink_to("nonexistent.py") + try: + symlink.symlink_to("nonexistent.py") + except OSError as e: + self.skipTest(f"Can't create symlinks: {e}") result = CliRunner().invoke(black.main, [str(workspace.resolve())]) self.assertEqual(result.exit_code, 0)