From d7a41d88c39c448dd87c7906f21db799e3f63de3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 24 Feb 2018 14:36:18 -0800 Subject: [PATCH] Don't write to the home directory under test --- tests/commands/install_uninstall_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py index ea6727e4..00d5eff4 100644 --- a/tests/commands/install_uninstall_test.py +++ b/tests/commands/install_uninstall_test.py @@ -187,11 +187,14 @@ def test_unicode_merge_commit_message(tempdir_factory): with cwd(path): assert install(Runner(path, C.CONFIG_FILE)) == 0 cmd_output('git', 'checkout', 'master', '-b', 'foo') - cmd_output('git', 'commit', '--allow-empty', '-m', 'branch2') + cmd_output('git', 'commit', '--allow-empty', '-n', '-m', 'branch2') cmd_output('git', 'checkout', 'master') cmd_output('git', 'merge', 'foo', '--no-ff', '--no-commit', '-m', '☃') # Used to crash - cmd_output('git', 'commit', '--no-edit') + cmd_output_mocked_pre_commit_home( + 'git', 'commit', '--no-edit', + tempdir_factory=tempdir_factory, + ) def test_install_idempotent(tempdir_factory):