-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Disable qtlog #58
Disable qtlog #58
Conversation
@@ -43,6 +43,8 @@ For example: | |||
1 failed in 0.01 seconds | |||
|
|||
|
|||
**Disabling Loggin Capture** |
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.
Logging 😉
The diff looks good apart from the few inline comments. I'll test this with qutebrowser later. |
qInstallMsgHandler(self._previous_handler) | ||
|
||
@contextmanager | ||
def disabled(self): |
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.
Perhaps call this disable
instead of disabled
? Doing qtlog.disable()
seems more natural, disabled
sounds more like an attribute to check whether something is currently disabled.
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.
Hmm perhaps... I named it from "disabled within the context".
Either way, I think it is too late to rename it now without breaking semantic versioning... 😶
I now tried it and got this:
full output with some
|
Argh, I think I know what's going on... I had to create a thin wrapper so I will work on and the other points of your review tomorrow. Thanks! 😄 |
eadb2de
to
59f9396
Compare
Unfortunately I couldn't reproduce the error you had in
Is this failing in a different branch perhaps? Either way, I've removed the thin wrapper over |
Hey @The-Compiler, did you had a chance of checking if this last changes fixes the problem you were having? Or if you point me to a branch in |
I now tried again (in the logtest branch) and couldn't reproduce it either. However one test still fails (the one you showed above) which passed with pytest-qt 1.3.0. I don't really see why, but I haven't debugged it so far. |
Oh ok, I will take a look and see if it's a problem with the test or with |
Hey @The-Compiler, finally could tackle this, sorry for taking this long. I have figured out why
I hope all my explanation makes sense. 😄 In summary, the problem is that there's a conflict between I see a couple of options:
Let me know what you think, I would be glad to help with a PR or otherwise. 😄 Cheers, |
Thanks for the great explanation, it makes total sense! 😉 I already fixed the tests a while ago by using the loggers directly instead of qWarning() since what I actually want to test is the log filtering anyways. So I think this can be merged now (at least from my POV), in the hope someone other than me will find it useful 😄 |
@The-Compiler, can you do a quick review? Perhaps even test it with your code base to ensure everything is like you wanted. 😄