3
3
"""
4
4
5
5
import time
6
- import pytest
7
6
8
- from common .mavlink .modules import drone_odometry
7
+ from modules . common .mavlink .modules import drone_odometry
9
8
from modules .flight_interface import flight_interface
10
9
11
10
12
- @pytest .fixture ()
13
11
def create_flight_interface_instance (
14
12
address : str , timeout : float
15
13
) -> "tuple[bool, FlightInterface | None]" :
@@ -18,10 +16,9 @@ def create_flight_interface_instance(
18
16
"""
19
17
result , flight_interface_instance = flight_interface .FlightInterface .create (address , timeout )
20
18
21
- yield result , flight_interface_instance
19
+ return result , flight_interface_instance
22
20
23
21
24
- @pytest .fixture ()
25
22
def create_drone_position (
26
23
latitude : float , longitude : float , altitude : float
27
24
) -> drone_odometry .DronePosition :
@@ -33,7 +30,7 @@ def create_drone_position(
33
30
assert actual == expected
34
31
assert global_position is not None
35
32
36
- yield global_position
33
+ return global_position
37
34
38
35
39
36
class TestFlightInterface :
@@ -52,7 +49,7 @@ def test_create_invalid_address(self) -> None:
52
49
"""
53
50
expected_result = False
54
51
expected_instance = None
55
- actual_result , actual_instance = create_flight_interface_instance (None , self .TIMEOUT )
52
+ actual_result , actual_instance = create_flight_interface_instance ("" , self .TIMEOUT )
56
53
assert actual_result == expected_result
57
54
assert actual_instance == expected_instance
58
55
0 commit comments