Skip to content

Commit

Permalink
Merge pull request #2548 from blueyed/skip-fix-lineno
Browse files Browse the repository at this point in the history
Fix lineno offset in show_skipped
  • Loading branch information
nicoddemus authored Jul 25, 2017
2 parents 71947cb + 869eed9 commit 595ecd2
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 595ecd2

Please sign in to comment.