Difference between `pytestqt.exceptions.TimeoutError` and Python's `TimeoutError`
See original GitHub issuePython has a TimeoutError
already: https://docs.python.org/3/library/exceptions.html#TimeoutError
What is the purpose of pytestqt.exceptions.TimeoutError
, which is not derived from TimeoutError
? It is very easy write a
try:
...
except TimeoutError:
pass
that does not work as intended because one is missing from pytestqt.exceptions import TimeoutError
(which by the way gives:
Redefining built-in ‘TimeoutError’
in pylint
).
I think pytestqt.exceptions.TimeoutError
could be removed or, if it should be kept for compatibility, it should derive from TimeoutError
.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Difference between `pytestqt.exceptions.TimeoutError` and Python's ...
Python's TimeoutError is a subclass of OSError , and its description is: Raised when a system function timed out at the system level....
Read more >Source code for pytestqt.qtbot - Read the Docs
Source code for pytestqt.qtbot. import contextlib import weakref import warnings from pytestqt.exceptions import TimeoutError, ScreenshotError from ...
Read more >pytest-qt/qtbot.py at master - GitHub
TimeoutError <pytestqt.exceptions.TimeoutError>`. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen.
Read more >python 3.x - Catching exception 'TimeoutError' - Stack Overflow
In my opinion, the exception occurs in the list comprehension [x for x in ... except Exception: logger.error('An error occurred', exc_info=True).
Read more >pytestqt.exceptions.TimeoutError Example - Program Talk
python code examples for pytestqt.exceptions.TimeoutError. Learn how to use python api pytestqt.exceptions.TimeoutError.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree with @The-Compiler.
However we could rename it to something else to avoid confusion, say
QtTimeoutError
, or something like that.Python’s
TimeoutError
is a subclass ofOSError
, and its description is:What’s timing out in pytest-qt is not related to system functions, OS calls or errno in any way. pytest-qt raising an
OSError
for something not related to the OS at all seems like unnecessarily confusing to me, so I’m -1 on this.