Test that we get informative errors for various invalid inputs. Parameters: git_repo: temporary git repo
(git_repo: Path)
| 84 | |
| 85 | |
| 86 | def test_load_git_errors(git_repo: Path) -> None: |
| 87 | """Test that we get informative errors for various invalid inputs. |
| 88 | |
| 89 | Parameters: |
| 90 | git_repo: temporary git repo |
| 91 | """ |
| 92 | with pytest.raises(OSError, match="Not a git repository"): |
| 93 | load_git(MODULE_NAME, ref="v0.2.0", repo="not-a-repo") |
| 94 | |
| 95 | with pytest.raises(RuntimeError, match="Could not create git worktree"): |
| 96 | load_git(MODULE_NAME, ref="invalid-tag", repo=git_repo) |
| 97 | |
| 98 | with pytest.raises(ImportError, match="ModuleNotFoundError: No module named 'not_a_real_module'"): |
| 99 | load_git("not_a_real_module", ref="v0.2.0", repo=git_repo) |
| 100 | |
| 101 | |
| 102 | def test_git_failures(tmp_path: Path) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…