Skip to content

Commit

Permalink
Highlight the path of file location in error report
Browse files Browse the repository at this point in the history
    So that it's more obvious when we need to copy the file path.
  • Loading branch information
suzaku committed Jul 30, 2016
1 parent ffb583a commit af3b9b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ Trevor Bekolay
Wouter van Ackooy
Bernard Pratz
Javier Romero
Xuecong Liao
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
2.9.3.dev
=========

* Highlight path of the file location in the error report.

**Bug Fixes**

* Add an 'E' to the first line of error messages from FixtureLookupErrorRepr.
Expand Down
3 changes: 2 additions & 1 deletion _pytest/_code/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ def toterminal(self, tw):
i = msg.find("\n")
if i != -1:
msg = msg[:i]
tw.line("%s:%s: %s" %(self.path, self.lineno, msg))
tw.write(self.path, bold=True, Red=True)
tw.line(":%s: %s" % (self.lineno, msg))

class ReprLocals(TerminalRepr):
def __init__(self, lines):
Expand Down

0 comments on commit af3b9b0

Please sign in to comment.