Fix off-by-one error with lines from request.node.warn

The line numbers in `node.location` seem to be zero-based?!
This commit is contained in:
Daniel Hahler
2016-08-12 00:29:03 +02:00
parent 34925a31a9
commit 16cb5d01b1
3 changed files with 6 additions and 4 deletions

View File

@@ -267,7 +267,7 @@ class Node(object):
if fslocation is None:
fslocation = getattr(self, "fspath", None)
else:
fslocation = "%s:%s" % fslocation[:2]
fslocation = "%s:%s" % (fslocation[0], fslocation[1] + 1)
self.ihook.pytest_logwarning.call_historic(kwargs=dict(
code=code, message=message,