Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test that GitRepo can handle import failures #4942

Merged
merged 1 commit into from Jul 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/tests/streamlit/git_util_test.py
Expand Up @@ -76,3 +76,8 @@ def test_git_repo_valid(self):
repo = GitRepo(".")
self.assertTrue(repo.is_valid())
self.assertEqual((2, 20, 3), repo.git_version)

def test_gitpython_not_installed(self):
with patch.dict("sys.modules", {"git": None}):
repo = GitRepo(".")
self.assertFalse(repo.is_valid())
vdonato marked this conversation as resolved.
Show resolved Hide resolved