Skip to content

Commit a08733d

Browse files
committed
fix(test_cmd): handle GitCommandNotFound in test
Related to #248
1 parent 1c2dd54 commit a08733d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: git/test/test_git.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from git import (
2020
Git,
2121
GitCommandError,
22+
GitCommandNotFound,
2223
Repo
2324
)
2425
from gitdb.test.lib import with_rw_directory
@@ -127,11 +128,7 @@ def test_version(self):
127128

128129
def test_cmd_override(self):
129130
prev_cmd = self.git.GIT_PYTHON_GIT_EXECUTABLE
130-
if os.name == 'nt':
131-
exc = GitCommandError
132-
else:
133-
exc = OSError
134-
# end handle windows case
131+
exc = GitCommandNotFound
135132
try:
136133
# set it to something that doens't exist, assure it raises
137134
type(self.git).GIT_PYTHON_GIT_EXECUTABLE = os.path.join(

0 commit comments

Comments
 (0)