Skip to content

Commit 5dd838c

Browse files
committed
Getting new tests to not break existing tests.
Signed-off-by: Mike Stitt <[email protected]>
1 parent df22b32 commit 5dd838c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

subprojects/robotpy-wpilib/tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def nt(cfg_logging, wpilib_state):
5050
instance.stopLocal()
5151
instance._reset()
5252

53-
@pytest.fixture(scope="class", autouse=True)
53+
@pytest.fixture(scope="class", autouse=False)
5454
def physics_and_decorated_robot_class(myrobot_class, robots_sim_enable_physics)->tuple:
5555
# attach physics
5656

@@ -81,7 +81,7 @@ def robotInit(self):
8181

8282
return (physicsInterface, TestRobot)
8383

84-
@pytest.fixture(scope="function", autouse=True)
84+
@pytest.fixture(scope="function", autouse=False)
8585
def robot_with_sim_setup_teardown(physics_and_decorated_robot_class):
8686
"""
8787
Your robot instance
@@ -168,7 +168,7 @@ def robot_with_sim_setup_teardown(physics_and_decorated_robot_class):
168168
# hal.shutdown()
169169

170170
@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:
172172
"""
173173
A pytest fixture that provides control over your robot_with_sim_setup_teardown
174174
"""

subprojects/robotpy-wpilib/tests/test_poc_timedrobot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,20 @@ def robots_sim_enable_physics(cls) -> bool:
9494
return False
9595

9696

97-
def test_iterative(self, control, robot_with_sim_setup_teardown):
97+
def test_iterative(self, getTestController, robot_with_sim_setup_teardown):
9898
"""Ensure that all states of the iterative robot run"""
9999
assert robot_with_sim_setup_teardown.robotInitialized == False
100100
assert robot_with_sim_setup_teardown.robotPeriodicCount == 0
101-
run_practice(control)
101+
run_practice(getTestController)
102102

103103
assert robot_with_sim_setup_teardown.robotInitialized == True
104104
assert robot_with_sim_setup_teardown.robotPeriodicCount > 0
105105

106-
def test_iterative_again(self, control, robot_with_sim_setup_teardown):
106+
def test_iterative_again(self, getTestController, robot_with_sim_setup_teardown):
107107
"""Ensure that all states of the iterative robot run"""
108108
assert robot_with_sim_setup_teardown.robotInitialized == False
109109
assert robot_with_sim_setup_teardown.robotPeriodicCount == 0
110-
run_practice(control)
110+
run_practice(getTestController)
111111

112112
assert robot_with_sim_setup_teardown.robotInitialized == True
113113
assert robot_with_sim_setup_teardown.robotPeriodicCount > 0

0 commit comments

Comments
 (0)