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.
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
Improve stepwise to not forget failed tests #13122
Improve stepwise to not forget failed tests #13122
Changes from 6 commits
43064f5
40b38f9
1837858
b6f1dad
0c30a58
1f7a151
2fcaa79
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, where
%c
is "Locale’s appropriate date and time representation."?Without this, it gets displayed as e.g.
cache from 2025-01-15 14:25:45.458813
which seems a bit verbose, and the fractional seconds don't really add any useful information.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try that initially, but to me it showed up as the default locale (
C
): IIUC we need to calllocale.setlocale
at some point explicitly for%c
to work properly, otherwise it will always use theC
locale (and we cannot do that because this is a global setting, which pytest definitely should not touch IMO).But I might be wrong, can you test that in your machine?
If
%c
does not work, we might explicitly use%YY-%M-%d %h:%m:%s
to get rid of the fractional seconds, which I agree is not useful.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, looks like it! My locale setup is a bit weird at the moment anyways (experimented with en_DK to get proper dates, but turns out it's not supported everywhere so now I get a mess of formats...). Because of that, I expected that to be an issue on my end.
What do you think about making a
timedelta
to now and then just formatting that in instead? That would then show up as0:00:10 ago
or42 days, 1:23:45 ago
which seems a much nicer format for the information we actually want to convey here.edit: Whoops, I completely neglected that this would show microseconds too... I suppose that could be fixed with a
datetime.timedelta(seconds=int(td.total_seconds()))
(withtd
being the original delta).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea about
timedelta
, will do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I considered only showing that information if the cache was "old", but then what could be considered an "old" cache? 1 hr? 1 day? In the ended I kept it simple and always show the cache age for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, I have been thinking about that as well, and came to the same conclusion as you did 😅