Skip to content

Commit e1d2f4b

Browse files
Dmitry NikulinByron
Dmitry Nikulin
authored andcommitted
Add test that raises TypeError in git.execute(..., output_stream=file)
1 parent 92a4819 commit e1d2f4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: git/test/test_git.py

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import subprocess
99
import sys
10+
from tempfile import TemporaryFile
1011

1112
from git import (
1213
Git,
@@ -108,6 +109,11 @@ def test_it_ignores_false_kwargs(self, git):
108109
self.git.version(pass_this_kwarg=False)
109110
assert_true("pass_this_kwarg" not in git.call_args[1])
110111

112+
@raises(GitCommandError)
113+
def test_it_raises_proper_exception_with_output_stream(self):
114+
tmp_file = TemporaryFile()
115+
self.git.checkout('non-existent-branch', output_stream=tmp_file)
116+
111117
def test_it_accepts_environment_variables(self):
112118
filename = fixture_path("ls_tree_empty")
113119
with open(filename, 'r') as fh:

0 commit comments

Comments
 (0)