mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Add staged_files_only context manager.
This commit is contained in:
parent
749615118e
commit
4ed9120ae9
7 changed files with 287 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue