Skip to content

Commit 982eefb

Browse files
committed
fix(test_git): handle select.poll() missing
In that case, the handler for processing stdout and stderr of the git process is offloaded to threads. These currently don't return any exception they raise. We could easily fix this using an approach as shown [here](http://goo.gl/hnVax6).
1 parent 152a60f commit 982eefb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎git/test/test_git.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,14 @@ def test_environment(self, rw_dir):
192192
rw_repo=Repo.init(os.path.join(rw_dir, 'repo'))
193193
remote=rw_repo.create_remote('ssh-origin', "ssh://git@server/foo")
194194

195-
withrw_repo.git.custom_environment(GIT_SSH=path):
196-
try:
197-
remote.fetch()
198-
exceptGitCommandErroraserr:
199-
assert'FOO'instr(err)
195+
# This only works if we are not evaluating git-push/pull output in a thread !
196+
importselect
197+
ifhasattr(select, 'poll'):
198+
withrw_repo.git.custom_environment(GIT_SSH=path):
199+
try:
200+
remote.fetch()
201+
exceptGitCommandErroraserr:
202+
assert'FOO'instr(err)
203+
# end
200204
# end
201-
# end
205+
# end if select.poll exists

0 commit comments

Comments
(0)