Alina Lozovskaya
commited on
Commit
·
2426eeb
1
Parent(s):
94a21b7
Enhance typing in tests
Browse files
tests/audio/test_head_wobbler.py
CHANGED
|
@@ -4,7 +4,7 @@ import math
|
|
| 4 |
import time
|
| 5 |
import base64
|
| 6 |
import threading
|
| 7 |
-
from typing import Any
|
| 8 |
from collections.abc import Callable
|
| 9 |
|
| 10 |
import numpy as np
|
|
@@ -32,10 +32,10 @@ def _wait_for(predicate: Callable[[], bool], timeout: float = 0.6) -> bool:
|
|
| 32 |
return False
|
| 33 |
|
| 34 |
|
| 35 |
-
def _start_wobbler() ->
|
| 36 |
-
captured:
|
| 37 |
|
| 38 |
-
def capture(offsets:
|
| 39 |
captured.append((time.time(), offsets))
|
| 40 |
|
| 41 |
wobbler = HeadWobbler(set_speech_offsets=capture)
|
|
|
|
| 4 |
import time
|
| 5 |
import base64
|
| 6 |
import threading
|
| 7 |
+
from typing import Any, List, Tuple
|
| 8 |
from collections.abc import Callable
|
| 9 |
|
| 10 |
import numpy as np
|
|
|
|
| 32 |
return False
|
| 33 |
|
| 34 |
|
| 35 |
+
def _start_wobbler() -> Tuple[HeadWobbler, List[Tuple[float, Tuple[float, float, float, float, float, float]]]]:
|
| 36 |
+
captured: List[Tuple[float, Tuple[float, float, float, float, float, float]]] = []
|
| 37 |
|
| 38 |
+
def capture(offsets: Tuple[float, float, float, float, float, float]) -> None:
|
| 39 |
captured.append((time.time(), offsets))
|
| 40 |
|
| 41 |
wobbler = HeadWobbler(set_speech_offsets=capture)
|