mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Refactor fixtures in tests.
This commit is contained in:
parent
3baefd57e2
commit
85a76617c1
43 changed files with 249 additions and 278 deletions
|
|
@ -11,6 +11,21 @@ from pre_commit.commands.run import _has_unmerged_paths
|
|||
from pre_commit.commands.run import run
|
||||
from pre_commit.runner import Runner
|
||||
from testing.auto_namedtuple import auto_namedtuple
|
||||
from testing.fixtures import make_consuming_repo
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def repo_with_passing_hook(tmpdir_factory):
|
||||
git_path = make_consuming_repo(tmpdir_factory, 'script_hooks_repo')
|
||||
with local.cwd(git_path):
|
||||
yield git_path
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def repo_with_failing_hook(tmpdir_factory):
|
||||
git_path = make_consuming_repo(tmpdir_factory, 'failing_hook_repo')
|
||||
with local.cwd(git_path):
|
||||
yield git_path
|
||||
|
||||
|
||||
def stage_a_file():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue