mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
Move empty_git_dir out of pytest fixtures.
This commit is contained in:
parent
7b1230df27
commit
047a933554
10 changed files with 159 additions and 99 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os.path
|
||||
|
|
@ -5,16 +6,19 @@ import os.path
|
|||
from pre_commit.runner import Runner
|
||||
from pre_commit.commands.install import install
|
||||
from pre_commit.commands.uninstall import uninstall
|
||||
from testing.fixtures import git_dir
|
||||
|
||||
|
||||
def test_uninstall_pre_commit_does_not_blow_up_when_not_there(empty_git_dir):
|
||||
runner = Runner(empty_git_dir)
|
||||
def test_uninstall_does_not_blow_up_when_not_there(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
runner = Runner(path)
|
||||
ret = uninstall(runner)
|
||||
assert ret == 0
|
||||
|
||||
|
||||
def test_uninstall(empty_git_dir):
|
||||
runner = Runner(empty_git_dir)
|
||||
def test_uninstall(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
runner = Runner(path)
|
||||
assert not os.path.exists(runner.pre_commit_path)
|
||||
install(runner)
|
||||
assert os.path.exists(runner.pre_commit_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue