Skip to content
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

Reports for unexpected qWarnings should show correct line number #55

Closed
The-Compiler opened this issue Jun 8, 2015 · 1 comment
Closed

Comments

@The-Compiler
Copy link
Member

Currently, if I have a file like this:

96 # [...]
97
98 def test_warning():
99    qWarning("hello world")

pytest-qt shows a warning on line 97 (which is empty):

_______________________________ test_warning ________________________________
tests/utils/test_qtutils.py:97: Failure: Qt messages with level WARNING or above emitted
--------------------------- Captured Qt messages ----------------------------
QtWarningMsg: hello world

At the very least, I think the line number should be the function where the issue actually occured.

However, on Qt5 (with qInstallMessageHandler support) it'd also be possible to report the exact location in the captured log message, which would be useful.

I might submit a PR for the latter somewhen this or next week, but if you have the time, feel free to do it 😉

@nicoddemus
Copy link
Member

Thanks! Strange that I failed to notice this... I will try to tackle this today. 😄

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

No branches or pull requests

2 participants