mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
Merge pull request #704 from pre-commit/no_home
remove need for monkeypatching home
This commit is contained in:
commit
714bb60f15
1 changed files with 9 additions and 13 deletions
|
|
@ -85,10 +85,9 @@ xfailif_no_gitlfs = pytest.mark.xfail(
|
|||
|
||||
|
||||
@xfailif_no_gitlfs
|
||||
def test_allows_gitlfs(temp_git_dir, monkeypatch): # pragma: no cover
|
||||
def test_allows_gitlfs(temp_git_dir): # pragma: no cover
|
||||
with temp_git_dir.as_cwd():
|
||||
monkeypatch.setenv('HOME', str(temp_git_dir))
|
||||
cmd_output('git', 'lfs', 'install')
|
||||
cmd_output('git', 'lfs', 'install', '--local')
|
||||
temp_git_dir.join('f.py').write('a' * 10000)
|
||||
cmd_output('git', 'lfs', 'track', 'f.py')
|
||||
cmd_output('git', 'add', '--', '.')
|
||||
|
|
@ -97,10 +96,9 @@ def test_allows_gitlfs(temp_git_dir, monkeypatch): # pragma: no cover
|
|||
|
||||
|
||||
@xfailif_no_gitlfs
|
||||
def test_moves_with_gitlfs(temp_git_dir, monkeypatch): # pragma: no cover
|
||||
def test_moves_with_gitlfs(temp_git_dir): # pragma: no cover
|
||||
with temp_git_dir.as_cwd():
|
||||
monkeypatch.setenv('HOME', str(temp_git_dir))
|
||||
cmd_output('git', 'lfs', 'install')
|
||||
cmd_output('git', 'lfs', 'install', '--local')
|
||||
cmd_output('git', 'lfs', 'track', 'a.bin', 'b.bin')
|
||||
# First add the file we're going to move
|
||||
temp_git_dir.join('a.bin').write('a' * 10000)
|
||||
|
|
@ -112,10 +110,9 @@ def test_moves_with_gitlfs(temp_git_dir, monkeypatch): # pragma: no cover
|
|||
|
||||
|
||||
@xfailif_no_gitlfs
|
||||
def test_enforce_allows_gitlfs(temp_git_dir, monkeypatch): # pragma: no cover
|
||||
def test_enforce_allows_gitlfs(temp_git_dir): # pragma: no cover
|
||||
with temp_git_dir.as_cwd():
|
||||
monkeypatch.setenv('HOME', str(temp_git_dir))
|
||||
cmd_output('git', 'lfs', 'install')
|
||||
cmd_output('git', 'lfs', 'install', '--local')
|
||||
temp_git_dir.join('f.py').write('a' * 10000)
|
||||
cmd_output('git', 'lfs', 'track', 'f.py')
|
||||
cmd_output('git', 'add', '--', '.')
|
||||
|
|
@ -123,11 +120,10 @@ def test_enforce_allows_gitlfs(temp_git_dir, monkeypatch): # pragma: no cover
|
|||
assert main(('--enforce-all', '--maxkb', '9', 'f.py')) == 0
|
||||
|
||||
|
||||
@xfailif_no_gitlfs # pragma: no cover
|
||||
def test_enforce_allows_gitlfs_after_commit(temp_git_dir, monkeypatch):
|
||||
@xfailif_no_gitlfs
|
||||
def test_enforce_allows_gitlfs_after_commit(temp_git_dir): # pragma: no cover
|
||||
with temp_git_dir.as_cwd():
|
||||
monkeypatch.setenv('HOME', str(temp_git_dir))
|
||||
cmd_output('git', 'lfs', 'install')
|
||||
cmd_output('git', 'lfs', 'install', '--local')
|
||||
temp_git_dir.join('f.py').write('a' * 10000)
|
||||
cmd_output('git', 'lfs', 'track', 'f.py')
|
||||
cmd_output('git', 'add', '--', '.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue