adjust error outputs to be more standardized
diff --git a/tests/check_docstring_first_test.py b/tests/check_docstring_first_test.py
index 079896f..8bafae8 100644
--- a/tests/check_docstring_first_test.py
+++ b/tests/check_docstring_first_test.py
@@ -17,7 +17,7 @@
b'from __future__ import unicode_literals\n'
b'"foo"\n',
1,
- '{filename}:2 Module docstring appears after code '
+ '{filename}:2: Module docstring appears after code '
'(code seen on line 1).\n',
),
# Test double docstring
@@ -26,7 +26,7 @@
b'from __future__ import absolute_import\n'
b'"fake docstring"\n',
1,
- '{filename}:3 Multiple module docstrings '
+ '{filename}:3: Multiple module docstrings '
'(first docstring on line 1).\n',
),
# Test multiple lines of code above
@@ -35,7 +35,7 @@
b'import sys\n'
b'"docstring"\n',
1,
- '{filename}:3 Module docstring appears after code '
+ '{filename}:3: Module docstring appears after code '
'(code seen on line 1).\n',
),
# String literals in expressions are ok.
diff --git a/tests/check_merge_conflict_test.py b/tests/check_merge_conflict_test.py
index d3322db..76c4283 100644
--- a/tests/check_merge_conflict_test.py
+++ b/tests/check_merge_conflict_test.py
@@ -101,8 +101,14 @@
@pytest.mark.usefixtures('f1_is_a_conflict_file')
-def test_merge_conflicts_git():
+def test_merge_conflicts_git(capsys):
assert main(['f1']) == 1
+ out, _ = capsys.readouterr()
+ assert out == (
+ "f1:1: Merge conflict string '<<<<<<<' found\n"
+ "f1:3: Merge conflict string '=======' found\n"
+ "f1:5: Merge conflict string '>>>>>>>' found\n"
+ )
@pytest.mark.parametrize(
@@ -139,7 +145,7 @@
assert main([str(f.realpath()), '--assume-in-merge']) == 1
-def test_worktree_merge_conflicts(f1_is_a_conflict_file, tmpdir):
+def test_worktree_merge_conflicts(f1_is_a_conflict_file, tmpdir, capsys):
worktree = tmpdir.join('worktree')
cmd_output('git', 'worktree', 'add', str(worktree))
with worktree.as_cwd():
@@ -148,4 +154,4 @@
)
msg = f1_is_a_conflict_file.join('.git/worktrees/worktree/MERGE_MSG')
assert msg.exists()
- test_merge_conflicts_git()
+ test_merge_conflicts_git(capsys)
diff --git a/tests/debug_statement_hook_test.py b/tests/debug_statement_hook_test.py
index 349fe89..5a8e0bb 100644
--- a/tests/debug_statement_hook_test.py
+++ b/tests/debug_statement_hook_test.py
@@ -55,7 +55,9 @@
assert main((str(f_py),)) == 0
-def test_py37_breakpoint(tmpdir):
+def test_py37_breakpoint(tmpdir, capsys):
f_py = tmpdir.join('f.py')
f_py.write('def f():\n breakpoint()\n')
assert main((str(f_py),)) == 1
+ out, _ = capsys.readouterr()
+ assert out == f'{f_py}:2:4: breakpoint called\n'