-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced nodeids to include line numbers #5241
Labels
topic: reporting
related to terminal output and user-facing messages and errors
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
Comments
Actually for the short test summary we could just go with
|
blueyed
added a commit
to blueyed/pytest
that referenced
this issue
May 10, 2019
2 tasks
But that makes it difficult for pytest to pick it up then, since |
blueyed
added a commit
to blueyed/pytest
that referenced
this issue
Nov 1, 2019
blueyed
added a commit
to blueyed/pytest
that referenced
this issue
Nov 1, 2019
Uses "%s:%d(%s)" % (path,) Uses `"%s:%d(%s)" % (path, testloc.lineno, testname)` for locations in tests, and `"%s (%s:%d)" % (nodeid, testloc_path, testloc.lineno)` otherwise. Fixes pytest-dev#5241. Closes #38.
Done in my fork: blueyed@c947224 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
topic: reporting
related to terminal output and user-facing messages and errors
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
Pytest should handle an extended nodeid format of
fname:lnum::func
, which is would then use with the short test summary (for easier selection of tests in an editor).The format currently is
fname::func
, which is good in terms of being stable across file changes and when referring to tests themselves, but for errors / test failures it should be more specific (i.e. include the line number).An alternative might be
fname::func:lnum
, but this is not that easy for editors to parse (but basically you would have to ignore the "::func" therin.As for the short test summary, it could also just display
fname:lineno
there, but I think it is useful to have the test name there also.Originally posted by @blueyed in #5002 (comment)
The text was updated successfully, but these errors were encountered: