mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-03 05:49:14 -05:00
Add staged_files_only context manager.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user