Add staged_files_only context manager.

This commit is contained in:
Anthony Sottile 2014-04-05 18:41:49 -07:00
parent 749615118e
commit 4ed9120ae9
7 changed files with 287 additions and 9 deletions

View file

@ -9,6 +9,16 @@ from pre_commit.prefixed_command_runner import CalledProcessError
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
def test_CalledProcessError_str():
error = CalledProcessError(1, ['git', 'status'], 0, ('stdout', 'stderr'))
assert str(error) == (
"Command: ['git', 'status']\n"
"Return code: 1\n"
"Expected return code: 0\n"
"Output: ('stdout', 'stderr')\n"
)
@pytest.fixture
def popen_mock():
popen = mock.Mock(spec=subprocess.Popen)