question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Difference between `pytestqt.exceptions.TimeoutError` and Python's `TimeoutError`

See original GitHub issue

Python 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:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Oct 18, 2022

I agree with @The-Compiler.

However we could rename it to something else to avoid confusion, say QtTimeoutError, or something like that.

1reaction
The-Compilercommented, Oct 18, 2022

Python’s TimeoutError is a subclass of OSError, and its description is:

Raised when a system function timed out at the system level. Corresponds to errno ETIMEDOUT.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found