@@ -224,16 +224,17 @@ def test_environment_not_sourced(tempdir_factory):
224224
225225 # Use a specific homedir to ignore --user installs
226226 homedir = tempdir_factory .get ()
227- # Need this so we can call git commit without sploding
228- with io .open (os .path .join (homedir , '.gitconfig' ), 'w' ) as gitconfig :
229- gitconfig .write (
230- '[user]\n '
231- ' name = Travis CI\n '
232- ' email = user@example.com\n '
233- )
234227 ret , stdout , stderr = cmd_output (
235228 'git' , 'commit' , '--allow-empty' , '-m' , 'foo' ,
236- env = {'HOME' : homedir , 'PATH' : _path_without_us ()},
229+ env = {
230+ 'HOME' : homedir ,
231+ 'PATH' : _path_without_us (),
232+ # Git needs this to make a commit
233+ 'GIT_AUTHOR_NAME' : os .environ ['GIT_AUTHOR_NAME' ],
234+ 'GIT_COMMITTER_NAME' : os .environ ['GIT_COMMITTER_NAME' ],
235+ 'GIT_AUTHOR_EMAIL' : os .environ ['GIT_AUTHOR_EMAIL' ],
236+ 'GIT_COMMITTER_EMAIL' : os .environ ['GIT_COMMITTER_EMAIL' ],
237+ },
237238 retcode = None ,
238239 )
239240 assert ret == 1
@@ -475,6 +476,11 @@ def test_installed_from_venv(tempdir_factory):
475476 'SYSTEMROOT' : os .environ .get ('SYSTEMROOT' , '' ),
476477 # Windows needs this to resolve executables
477478 'PATHEXT' : os .environ .get ('PATHEXT' , '' ),
479+ # Git needs this to make a commit
480+ 'GIT_AUTHOR_NAME' : os .environ ['GIT_AUTHOR_NAME' ],
481+ 'GIT_COMMITTER_NAME' : os .environ ['GIT_COMMITTER_NAME' ],
482+ 'GIT_AUTHOR_EMAIL' : os .environ ['GIT_AUTHOR_EMAIL' ],
483+ 'GIT_COMMITTER_EMAIL' : os .environ ['GIT_COMMITTER_EMAIL' ],
478484 },
479485 )
480486 assert ret == 0
0 commit comments