Skip to content

FIX: debug-mode and logging bugs in #337#354

Merged
Erotemic merged 1 commit into
pyutils:mainfrom
TTsangSC:logging-fixes
Jul 7, 2025
Merged

FIX: debug-mode and logging bugs in #337#354
Erotemic merged 1 commit into
pyutils:mainfrom
TTsangSC:logging-fixes

Conversation

@TTsangSC
Copy link
Copy Markdown
Collaborator

@TTsangSC TTsangSC commented Jul 7, 2025

Changes

  • kernprof.py
    • _gather_preimport_targets():
      Fixed typo (diagnostics.log.warn -> diagnostics.log.warning)
    • _format_call_message():
      • Added handling for functools.partial
      • Added fallback handling for arbitrary callable
  • tests/test_kernprof.py
    • test_bad_prof_mod_target():
      New test triggering the warning in _gather_preimport_targets()
    • test_call_with_diagnostics():
      New test for the various forms in which _call_with_diagnostics() is used

kernprof.py
    _gather_preimport_targets()
        Fixed typo (`diagnostics.log.warn` -> `diagnostics.log.warning`)
    _format_call_message()
        - Added handling for `functools.partial`
        - Added fallback handling for arbitrary callable

tests/test_kernprof.py
    test_bad_prof_mod_target()
        Test triggering the warning in `_gather_preimport_targets()`
    test_call_with_diagnostics()
        Test the various forms in which `_call_with_diagnostics()` is
        used
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.82%. Comparing base (733495c) to head (b75065c).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   69.14%   69.82%   +0.68%     
==========================================
  Files          18       18              
  Lines        1614     1614              
  Branches      344      344              
==========================================
+ Hits         1116     1127      +11     
+ Misses        420      410      -10     
+ Partials       78       77       -1     

see 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d2c415...b75065c. Read the comment docs.

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

@Erotemic
Copy link
Copy Markdown
Member

Erotemic commented Jul 7, 2025

LGTM, great work as always. I really appreciate the time and effort you are putting into this project. You're making software better for a lot of people. I think we are close to getting all of the PRs merged and making a significant 4.3 release.

@Erotemic Erotemic merged commit cd09484 into pyutils:main Jul 7, 2025
36 checks passed
@TTsangSC TTsangSC deleted the logging-fixes branch July 8, 2025 04:34
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