diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-06-10 15:10:27 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-06-10 15:10:27 +0200 |
commit | 982eefb2008826604d54c1a6622c12240efb0961 (patch) | |
tree | 6f8610da8d87ed903efde1cb2b953404fcbeb057 /git/test/test_git.py | |
parent | 152a60f0bd7c5b495a3ce91d0e45393879ec0477 (diff) | |
download | gitpython-982eefb2008826604d54c1a6622c12240efb0961.tar.gz |
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).
Diffstat (limited to 'git/test/test_git.py')
-rw-r--r-- | git/test/test_git.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/git/test/test_git.py b/git/test/test_git.py index 742c842d..a4172f7a 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -192,10 +192,14 @@ class TestGit(TestBase): rw_repo = Repo.init(os.path.join(rw_dir, 'repo')) remote = rw_repo.create_remote('ssh-origin', "ssh://git@server/foo") - with rw_repo.git.custom_environment(GIT_SSH=path): - try: - remote.fetch() - except GitCommandError as err: - assert 'FOO' in str(err) + # This only works if we are not evaluating git-push/pull output in a thread ! + import select + if hasattr(select, 'poll'): + with rw_repo.git.custom_environment(GIT_SSH=path): + try: + remote.fetch() + except GitCommandError as err: + assert 'FOO' in str(err) + # end # end - # end + # end if select.poll exists |