Skip to content

Commit 77bbbc7

Browse files
committed
TST: Skip test_format_git_link if not run from within git repo
1 parent 44b9223 commit 77bbbc7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pdoc/test/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,8 @@ def test_extract_toc(self):
834834
toc = extract_toc(text)
835835
self.assertEqual(toc, expected)
836836

837-
@unittest.skipIf(shutil.which("git") is None, reason="test assumes git installed on system")
837+
@unittest.skipIf(shutil.which("git") is None or not os.path.exists('.git'),
838+
"git not installed or we're not within git repo")
838839
def test_format_git_link(self):
839840
url = format_git_link(
840841
template='https://github.com/pdoc3/pdoc/blob/{commit}/{path}#L{start_line}-L{end_line}',

0 commit comments

Comments
 (0)