Exemple #1
0
def test_qthreads_and_pythreads(qtbot):
    from xicam.core import threads
    import time
    from qtpy.QtWidgets import QMainWindow

    window = QMainWindow()

    @threads.method()
    def long_thread():
        time.sleep(100000)

    for i in range(1000):
        long_thread()

    time.sleep(.01)

    window.deleteLater()
Exemple #2
0
def test_exit_before_thread(qtbot):
    from xicam.core import threads
    import time
    from qtpy.QtWidgets import QMainWindow

    window = QMainWindow()

    def long_thread():
        time.sleep(100000)

    for i in range(1000):
        t = threads.QThreadFuture(long_thread)

        t.start()
    time.sleep(.01)

    window.deleteLater()