Skip to content

Commit 03babac

Browse files
authored
Test that GitRepo can handle import failures (#4942)
1 parent 4c39606 commit 03babac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/tests/streamlit/git_util_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,8 @@ def test_git_repo_valid(self):
7676
repo = GitRepo(".")
7777
self.assertTrue(repo.is_valid())
7878
self.assertEqual((2, 20, 3), repo.git_version)
79+
80+
def test_gitpython_not_installed(self):
81+
with patch.dict("sys.modules", {"git": None}):
82+
repo = GitRepo(".")
83+
self.assertFalse(repo.is_valid())

0 commit comments

Comments
 (0)