Files
pywebview/tests/util.py
Roman c5ff4e1362 Add test suite (#108)
* Add preliminary tests

* Tests experimentations

* Cosmetic changes

* Add preliminary tests

* Tests experimentations

* Cosmetic changes

* Make tests work on GTK/QT

* Fix confirm_quit on QT

* Add possibility to use env variables in config

* Add destroy event on event close in GTK

* Add queue to test_url_load

* Refine OSX tests
2017-04-27 16:08:51 +03:00

26 lines
487 B
Python

import threading
import time
import sys
from multiprocessing import Process
def destroy_window(webview, delay=3):
def stop():
time.sleep(delay)
webview.destroy_window()
if sys.platform == 'darwin':
from util_cocoa import mouseMoveRelative
mouseMoveRelative(1, 1)
t = threading.Thread(target=stop)
t.start()
def run_test(test_func):
p = Process(target=test_func)
p.start()
p.join()
assert p.exitcode == 0