79446625

Date: 2025-02-17 21:33:14
Score: 1
Natty:
Report link

Instead of using pytest.raises(ValueError), use pytestqt to intercept exceptions in Qt's event loop when testing:

with qtbot.capture_exceptions() as exceptions:
    qtbot.mouseClick(
        button, QtCore.MouseButton.LeftButton
    )

See the documentation here.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: David