This repository has been archived by the owner on Dec 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from NBISweden/feature/testnames
Output test names
- Loading branch information
Showing
4 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Configure tests to print the docstrings (and class+function names if no docstrings) | ||
|
||
def pytest_itemcollected(item): | ||
par = item.parent.obj | ||
node = item.obj | ||
# First line only | ||
prefix = par.__doc__.split('\n',1)[0].strip() if par.__doc__ else par.__class__.__name__ | ||
suffix = node.__doc__.split('\n',1)[0].strip() if node.__doc__ else node.__name__ | ||
if prefix or suffix: | ||
item._nodeid = ' | '.join((prefix, suffix)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters