File: test_busycursor.py

package info (click to toggle)
python-pyqtgraph 0.13.7-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,072 kB
  • sloc: python: 54,043; makefile: 127; ansic: 40; sh: 2
file content (20 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pytest
import sys

import pyqtgraph as pg

pg.mkQApp()

@pytest.mark.skipif(
    sys.platform.startswith("linux")
    and pg.Qt.QT_LIB == "PySide6"
    and (6, 0) < pg.Qt.PySide6.__version_info__ < (6, 4, 3),
    reason="taking gui thread causes segfault"
)
def test_nested_busy_cursors_clear_after_all_exit():
    with pg.BusyCursor():
        wait_cursor = pg.Qt.QtCore.Qt.CursorShape.WaitCursor
        with pg.BusyCursor():
            assert pg.Qt.QtWidgets.QApplication.overrideCursor().shape() == wait_cursor, "Cursor should be waiting"
        assert pg.Qt.QtWidgets.QApplication.overrideCursor().shape() == wait_cursor, "Cursor should be waiting"
    assert pg.Qt.QtWidgets.QApplication.overrideCursor() is None, "No override cursor should be set"