Logging: Make pytest_runtest_logreport() hook available for logging#4812
Conversation
nicoddemus
left a comment
There was a problem hiding this comment.
Thanks @mitzkia!
Looking good so far, but we still need:
-
A test
-
A new changelog entry. I suggest:
Logging messages inside ``pytest_runtest_logreport()`` are now properly captured and displayed.
|
@nicoddemus, Thank you for the help. Sorry, but yesterday I was in a little hurry (just wanted to run my code on CI). In this PR I also wanted to check if any other hook is related here. |
|
As I check the following hooks can be also affected: After I have added the missing methods to logging.py, the logging will work for the following hooks also: Finally I would rewrite this PR title and extend the fix/tests/doc to the following hooks: |
|
About the unit-tests:
|
|
ok, sorry it did work. So pytest_runtestloop() hook is already fine. |
|
After understanding that there are still other hooks, I just check again all of them (there are at all 52 hooks). |
|
May I fix all of them? |
|
After checking some of the hooks, the fix will not easy (for all of them). There are some hooks which are not belongs to any class... |
|
Hi @mitzkia,
Many hook calls are nested (for example, |
|
A quick glance shows that Other hooks might be difficult/impossible because they are called very early on the plugin system, and would require a deeper look. I suggest we just wrap |
53187d3 to
c8deb03
Compare
|
Hi @nicoddemus, Thanks for the explanations. I have updated my PR. I hope the CI will passed :) |
c8deb03 to
de91ef8
Compare
Codecov Report
@@ Coverage Diff @@
## master #4812 +/- ##
==========================================
- Coverage 95.75% 95.19% -0.57%
==========================================
Files 113 113
Lines 25653 25158 -495
Branches 2505 2495 -10
==========================================
- Hits 24564 23949 -615
- Misses 770 875 +105
- Partials 319 334 +15
Continue to review full report at Codecov.
|
de91ef8 to
e9faa9a
Compare
Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
e9faa9a to
b26b731
Compare
|
I assume the change/PR is correct (final) for now. Thank you. |
nicoddemus
left a comment
There was a problem hiding this comment.
Thanks @mitzkia! Indeed the failures are unrelated, I'm pushing a new PR to fix them shortly. 👍
Signed-off-by: Andras Mitzki andras.mitzki@balabit.com