mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-17 22:40:11 -06:00
Fix test error "fatal: empty ident name (for <(null)>) not allowed"
Occurs when tests run with tox not with Travis CI or Appveyor Changed existing tox setenv statement to use whitespace around `=` as per http://tox.readthedocs.io/en/latest/example/basic.html#setting-environment-variables
This commit is contained in:
@@ -223,16 +223,17 @@ def test_environment_not_sourced(tempdir_factory):
|
||||
|
||||
# Use a specific homedir to ignore --user installs
|
||||
homedir = tempdir_factory.get()
|
||||
# Need this so we can call git commit without sploding
|
||||
with io.open(os.path.join(homedir, '.gitconfig'), 'w') as gitconfig:
|
||||
gitconfig.write(
|
||||
'[user]\n'
|
||||
' name = Travis CI\n'
|
||||
' email = user@example.com\n'
|
||||
)
|
||||
ret, stdout, stderr = cmd_output(
|
||||
'git', 'commit', '--allow-empty', '-m', 'foo',
|
||||
env={'HOME': homedir, 'PATH': _path_without_us()},
|
||||
env={
|
||||
'HOME': homedir,
|
||||
'PATH': _path_without_us(),
|
||||
# Git needs this to make a commit
|
||||
'GIT_AUTHOR_NAME': os.environ['GIT_AUTHOR_NAME'],
|
||||
'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'],
|
||||
'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'],
|
||||
'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'],
|
||||
},
|
||||
retcode=None,
|
||||
)
|
||||
assert ret == 1
|
||||
@@ -474,6 +475,11 @@ def test_installed_from_venv(tempdir_factory):
|
||||
'SYSTEMROOT': os.environ.get('SYSTEMROOT', ''),
|
||||
# Windows needs this to resolve executables
|
||||
'PATHEXT': os.environ.get('PATHEXT', ''),
|
||||
# Git needs this to make a commit
|
||||
'GIT_AUTHOR_NAME': os.environ['GIT_AUTHOR_NAME'],
|
||||
'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'],
|
||||
'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'],
|
||||
'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'],
|
||||
},
|
||||
)
|
||||
assert ret == 0
|
||||
|
||||
Reference in New Issue
Block a user