-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Improved time counter used to compute test durations. #6939
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
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
04c5ca5
Improved time counter used to compute test durations. `CallInfo.start…
bf03b05
Added changelog and authors
bdb0d19
Linter fix
55d484c
Linter fix 2
8c041d3
Improved terminal message when the `--duration` option is used so as …
4d77bb2
Updated durations test to match the new terminal output
1c50d3d
make linter happy
47de8b8
As per code review: renamed towncrier changelog file
23d7a6c
New when `time.perf_counter_ns` is available (python >= 3.7) it is us…
481ba13
Edited changelog according to latest proposal
1649820
Linter/black edit
e1eb122
Made one test a little looser
5373d18
Attempt to improve terminal reporting again
70460b5
Modified tests so that they now pass of windows
e060ee0
Fixed test mistake on windows
2450d0c
Linter fixes
7997436
Flake8 fix
8099f02
Code simplification for linter: `duration_ns` is now always present b…
c828c0b
Updated changelog
a94382f
mypy fix
15d0a22
Tiny fix: now `duration_ns` attribute is always available on `TestRep…
8455b07
Fixed typos in comments
4743e49
Merge branch 'master' of https://github.com/pytest-dev/pytest into fi…
22c2dbc
Added docstring for `CallInfo`
f527d84
Merge branch 'master' of https://github.com/pytest-dev/pytest into fi…
2f6ffde
Update src/_pytest/runner.py
smarie 92017f6
Update src/_pytest/runner.py
smarie b8830d9
Update src/_pytest/runner.py
smarie 37347e2
Merge branch 'fix_issue_4391' of https://github.com/smarie/pytest int…
514f055
Merge branch 'master' of https://github.com/pytest-dev/pytest into fi…
99b779e
Added type hints for `CallInfo`
a1e92e9
as per code review using sys.platform instead of the platform module
7f37a49
lint fix
9a33ef4
Improved changelog
51ebcba
As per code review: removed duration_ns from the picture
4b23061
Final changelog update
a2f682c
Added changelog for the terminal improvement
c86a42b
Minor docstring edits
8a27c97
Minor docstring edits
daa588c
docstring update as per code review
533e5ec
Update docstring as per request in code review
nicoddemus 57f8a41
Fix linting
nicoddemus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
| Improved precision of test durations measurement. ``CallInfo`` items now have a new ``<CallInfo>.duration`` attribute, created using ``time.perf_counter()``. This attribute is used to fill the ``<TestReport>.duration`` attribute, which is more accurate than the previous ``<CallInfo>.stop - <CallInfo>.start`` (as these are based on ``time.time()``). |
This file contains hidden or 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 @@ | ||
| When using the ``--duration`` option, the terminal message output is now more precise about the number and durations of hidden items. |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.