Skip to content

Commit

Permalink
Test that GitRepo can handle import failures (#4942)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdonato committed Jul 8, 2022
1 parent 4c39606 commit 03babac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/tests/streamlit/git_util_test.py
Original file line number Diff line number Diff line change
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())

0 comments on commit 03babac

Please sign in to comment.