Skip to content

Let print_timer() print a Section - #239

Open
johnomotani wants to merge 1 commit into
KristofferC:masterfrom
johnomotani:print_timer-Section
Open

Let print_timer() print a Section#239
johnomotani wants to merge 1 commit into
KristofferC:masterfrom
johnomotani:print_timer-Section

Conversation

@johnomotani

Copy link
Copy Markdown

Allow print_timer() to print Section as well as TimerOutput.

The 1.0 update (I guess) meant that to["foo"] is a Section, not a TimerOutput. This meant that print_timer(to["foo"]) errored. It would be possible to work around this by calling show_table() directly, but print_timer() is part of the public API and show_table() is not, so this looks like a bug. To reproduce (or see that it is fixed with this PR):

using TimerOutputs
to = TimerOutput()
@timeit to "foo" sleep(1)
print_timer(to["foo"])

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.93%. Comparing base (ada4b6c) to head (7adc294).
⚠️ Report is 46 commits behind head on master.

Files with missing lines Patch % Lines
src/printing.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #239       +/-   ##
===========================================
+ Coverage   84.82%   94.93%   +10.10%     
===========================================
  Files           5        9        +4     
  Lines         323      948      +625     
===========================================
+ Hits          274      900      +626     
+ Misses         49       48        -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KristofferC

Copy link
Copy Markdown
Owner

Could maybe use a test

@johnomotani

Copy link
Copy Markdown
Author

Could maybe use a test

What kind of test is appropriate? Just something that calls print_timer() with a Section and sees that it does not error? I can probably add that next week some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants