-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
status: help wanteddevelopers would like help from experts on this topicdevelopers would like help from experts on this topictype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
With pytest (I'm currently using 3.6.1), there's support for showing progress of tests, but when running a collection of 1300 tests, each test contributes very little to the percentage. I'd prefer to be able to show the bare counter. Example (with space padding): test_whatever [ 1/1357]
In my framework, I'm monkey-patching pytest to get what I want, but it would be more maintainable if pytest supported that style officially.
My current monkey-patch:
def _get_progress(self):
"""
Report progress in number of tests, not percentage.
Since we have thousands of tests, 1% is still several tests.
"""
collected = self._session.testscollected
self._PROGRESS_LENGTH = len(' [%d/%d]' % (collected, collected))
if collected:
spacing = len(str(collected))
current = len(self._progress_nodeids_reported)
fmt = ' [{:%sd}/{}]' % spacing
return fmt.format(current, collected)
return ' []'
TerminalReporter._PROGRESS_LENGTH = len(' [9999/9999]')
TerminalReporter._get_progress_information_message = _get_progress
Metadata
Metadata
Assignees
Labels
status: help wanteddevelopers would like help from experts on this topicdevelopers would like help from experts on this topictype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature