mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
Python: run mypy on the tests
This commit is contained in:
parent
c111098e49
commit
607d70b3fa
21 changed files with 169 additions and 69 deletions
|
@ -6,10 +6,13 @@ from slint import slint as native
|
|||
from slint.slint import ValueType;
|
||||
from datetime import timedelta
|
||||
|
||||
def test_timer():
|
||||
counter: int
|
||||
|
||||
|
||||
def test_timer() -> None:
|
||||
global counter
|
||||
counter = 0
|
||||
def quit_after_two_invocations():
|
||||
def quit_after_two_invocations() -> None:
|
||||
global counter
|
||||
counter = min(counter + 1, 2)
|
||||
if counter == 2:
|
||||
|
@ -21,6 +24,6 @@ def test_timer():
|
|||
test_timer.stop()
|
||||
assert(counter == 2)
|
||||
|
||||
def test_single_shot():
|
||||
def test_single_shot() -> None:
|
||||
native.Timer.single_shot(timedelta(milliseconds=100), native.quit_event_loop)
|
||||
native.run_event_loop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue