Skip symlink test if can't create one (#287)
This commit is contained in:
parent
a80e037a9a
commit
ef903ecd46
@ -731,7 +731,10 @@ def test_no_files(self) -> None:
|
|||||||
def test_broken_symlink(self) -> None:
|
def test_broken_symlink(self) -> None:
|
||||||
with cache_dir() as workspace:
|
with cache_dir() as workspace:
|
||||||
symlink = workspace / "broken_link.py"
|
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())])
|
result = CliRunner().invoke(black.main, [str(workspace.resolve())])
|
||||||
self.assertEqual(result.exit_code, 0)
|
self.assertEqual(result.exit_code, 0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user