Skip to content

Fix TypeError in git.execute(..., output_stream=file) #782

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add test that raises TypeError in git.execute(..., output_stream=file)
  • Loading branch information
Dmitry Nikulin committed Jul 24, 2018
commit 5a7ed7593d660107c9a9b2fb5ef08d6dde39fa60
6 changes: 6 additions & 0 deletions git/test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import subprocess
import sys
from tempfile import TemporaryFile

from git import (
Git,
Expand Down Expand Up @@ -108,6 +109,11 @@ def test_it_ignores_false_kwargs(self, git):
self.git.version(pass_this_kwarg=False)
assert_true("pass_this_kwarg" not in git.call_args[1])

@raises(GitCommandError)
def test_it_raises_proper_exception_with_output_stream(self):
tmp_file = TemporaryFile()
self.git.checkout('non-existent-branch', output_stream=tmp_file)

def test_it_accepts_environment_variables(self):
filename = fixture_path("ls_tree_empty")
with open(filename, 'r') as fh:
Expand Down