File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
subprojects/robotpy-wpilib/tests Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def nt(cfg_logging, wpilib_state):
50
50
instance .stopLocal ()
51
51
instance ._reset ()
52
52
53
- @pytest .fixture (scope = "class" , autouse = True )
53
+ @pytest .fixture (scope = "class" , autouse = False )
54
54
def physics_and_decorated_robot_class (myrobot_class , robots_sim_enable_physics )-> tuple :
55
55
# attach physics
56
56
@@ -81,7 +81,7 @@ def robotInit(self):
81
81
82
82
return (physicsInterface , TestRobot )
83
83
84
- @pytest .fixture (scope = "function" , autouse = True )
84
+ @pytest .fixture (scope = "function" , autouse = False )
85
85
def robot_with_sim_setup_teardown (physics_and_decorated_robot_class ):
86
86
"""
87
87
Your robot instance
@@ -168,7 +168,7 @@ def robot_with_sim_setup_teardown(physics_and_decorated_robot_class):
168
168
# hal.shutdown()
169
169
170
170
@pytest .fixture (scope = "function" )
171
- def control (reraise , robot_with_sim_setup_teardown : wpilib .RobotBase ) -> TestController :
171
+ def getTestController (reraise , robot_with_sim_setup_teardown : wpilib .RobotBase ) -> TestController :
172
172
"""
173
173
A pytest fixture that provides control over your robot_with_sim_setup_teardown
174
174
"""
Original file line number Diff line number Diff line change @@ -94,20 +94,20 @@ def robots_sim_enable_physics(cls) -> bool:
94
94
return False
95
95
96
96
97
- def test_iterative (self , control , robot_with_sim_setup_teardown ):
97
+ def test_iterative (self , getTestController , robot_with_sim_setup_teardown ):
98
98
"""Ensure that all states of the iterative robot run"""
99
99
assert robot_with_sim_setup_teardown .robotInitialized == False
100
100
assert robot_with_sim_setup_teardown .robotPeriodicCount == 0
101
- run_practice (control )
101
+ run_practice (getTestController )
102
102
103
103
assert robot_with_sim_setup_teardown .robotInitialized == True
104
104
assert robot_with_sim_setup_teardown .robotPeriodicCount > 0
105
105
106
- def test_iterative_again (self , control , robot_with_sim_setup_teardown ):
106
+ def test_iterative_again (self , getTestController , robot_with_sim_setup_teardown ):
107
107
"""Ensure that all states of the iterative robot run"""
108
108
assert robot_with_sim_setup_teardown .robotInitialized == False
109
109
assert robot_with_sim_setup_teardown .robotPeriodicCount == 0
110
- run_practice (control )
110
+ run_practice (getTestController )
111
111
112
112
assert robot_with_sim_setup_teardown .robotInitialized == True
113
113
assert robot_with_sim_setup_teardown .robotPeriodicCount > 0
You can’t perform that action at this time.
0 commit comments