Skip to content

Commit c4fcb6a

Browse files
authored
Merge pull request #296 from plox-sumit/fix/skip-symlink-tests-without-privilege
fix(test): skip two symlink tests where the OS refuses symlinks
2 parents 79124b3 + 4d6e243 commit c4fcb6a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎tests/test_superpowers_scenarios.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ def test_pytest_after_edit_fails_closed_on_broken_source_symlink(self):
362362
ws = Path(tmpdir)
363363
log = ws / "pytest.log"
364364
log.write_text("run\n")
365-
(ws / "broken.py").symlink_to(ws / "missing.py")
365+
try:
366+
(ws / "broken.py").symlink_to(ws / "missing.py")
367+
except OSError:
368+
pytest.skip("symlinks unavailable")
366369
assert _pytest_after_edit(log, ws) is False
367370

368371
@pytest.mark.skipif(os.name != "posix", reason="test executes POSIX pytest shims")
@@ -869,7 +872,10 @@ def test_symlinked_candidate_refused(self):
869872
real = Path(tmpdir) / "real.md"
870873
real.write_text("# x")
871874
link = Path(tmpdir) / "link.md"
872-
link.symlink_to(real)
875+
try:
876+
link.symlink_to(real)
877+
except OSError:
878+
pytest.skip("symlinks unavailable")
873879
with pytest.raises(ValueError, match="must not be a symlink"):
874880
SuperpowersEvaluator().evaluate(candidate_skill_path=str(link))
875881

0 commit comments

Comments
 (0)