|
26 | 26 |
|
27 | 27 |
|
28 | 28 | @pytest.fixture |
29 | | -def up_to_date(tempdir_factory): |
30 | | - yield make_repo(tempdir_factory, 'python_hooks_repo') |
| 29 | +def up_to_date(tmp_path): |
| 30 | + path = str(tmp_path) |
| 31 | + cmd_output('git', 'init', path) |
| 32 | + manifest = '''\ |
| 33 | +- id: foo |
| 34 | + name: Foo |
| 35 | + entry: foo.sh |
| 36 | + language: script |
| 37 | + files: '' |
| 38 | +''' |
| 39 | + tmp_path.joinpath('foo.sh').write_text('#!/usr/bin/env bash\necho "Hi!"') |
| 40 | + tmp_path.joinpath(C.MANIFEST_FILE).write_text(manifest) |
| 41 | + |
| 42 | + cmd_output('git', 'add', '.', cwd=path) |
| 43 | + git_commit(msg='make_repo', cwd=path) |
| 44 | + yield path |
31 | 45 |
|
32 | 46 |
|
33 | 47 | @pytest.fixture |
34 | | -def out_of_date(tempdir_factory): |
35 | | - path = make_repo(tempdir_factory, 'python_hooks_repo') |
| 48 | +def out_of_date(tmp_path): |
| 49 | + path = str(tmp_path) |
| 50 | + cmd_output('git', 'init', path) |
| 51 | + manifest = '''\ |
| 52 | +- id: foo |
| 53 | + name: Foo |
| 54 | + entry: foo.sh |
| 55 | + language: script |
| 56 | + files: '' |
| 57 | +''' |
| 58 | + tmp_path.joinpath('foo.sh').write_text('#!/usr/bin/env bash\necho "Hi!"') |
| 59 | + tmp_path.joinpath(C.MANIFEST_FILE).write_text(manifest) |
| 60 | + |
| 61 | + cmd_output('git', 'add', '.', cwd=path) |
| 62 | + git_commit(msg='make_repo', cwd=path) |
36 | 63 | original_rev = git.head_rev(path) |
37 | 64 |
|
38 | 65 | git_commit(cwd=path) |
@@ -420,7 +447,7 @@ def test_autoupdate_latest_no_config(out_of_date, in_tmpdir, store): |
420 | 447 | assert out_of_date.original_rev in f.read() |
421 | 448 |
|
422 | 449 |
|
423 | | -def test_hook_disppearing_repo_raises(hook_disappearing, store): |
| 450 | +def test_hook_disappearing_repo_raises(hook_disappearing, store): |
424 | 451 | config = make_config_from_repo( |
425 | 452 | hook_disappearing.path, |
426 | 453 | rev=hook_disappearing.original_rev, |
|
0 commit comments