Skip to content

Commit

Permalink
Fix lineno offset in show_skipped
Browse files Browse the repository at this point in the history
The line number is 0-based here, so add 1.
  • Loading branch information
blueyed committed Jul 25, 2017
1 parent 70d9f86 commit 869eed9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _pytest/skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,4 @@ def show_skipped(terminalreporter, lines):
reason = reason[9:]
lines.append(
"SKIP [%d] %s:%d: %s" %
(num, fspath, lineno, reason))
(num, fspath, lineno + 1, reason))
1 change: 1 addition & 0 deletions changelog/2548.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix lineno offset in show_skipped.
2 changes: 1 addition & 1 deletion testing/test_skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def doskip():
)
result = testdir.runpytest('-rs')
result.stdout.fnmatch_lines([
"*SKIP*2*conftest.py:3: test",
"*SKIP*2*conftest.py:4: test",
])
assert result.ret == 0

Expand Down

0 comments on commit 869eed9

Please sign in to comment.