From e1d2f4bc85da47b5863589a47b9246af0298f016 Mon Sep 17 00:00:00 2001 From: Dmitry Nikulin Date: Tue, 24 Jul 2018 23:43:35 +0300 Subject: Add test that raises TypeError in git.execute(..., output_stream=file) --- git/test/test_git.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git/test/test_git.py b/git/test/test_git.py index c6180f7c..cc931239 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -7,6 +7,7 @@ import os import subprocess import sys +from tempfile import TemporaryFile from git import ( Git, @@ -108,6 +109,11 @@ class TestGit(TestBase): 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: -- cgit v1.2.3