Fix unit test

This commit is contained in:
Remi Cadene
2024-09-26 13:09:08 +02:00
parent f2b1842d69
commit 3cb85bcd4b
3 changed files with 24 additions and 11 deletions

View File

@@ -213,11 +213,8 @@ def require_robot(func):
mock_cameras(request, camera_type)
mock_motors(request)
def mock_input(text):
print(text)
monkeypatch = request.getfixturevalue("monkeypatch")
# To run calibration without user input
monkeypatch = request.getfixturevalue("monkeypatch")
monkeypatch.setattr("builtins.input", mock_input)
# Run test with a real robot. Skip test if robot connection fails.
@@ -301,6 +298,11 @@ def require_motor(func):
return wrapper
def mock_input(text=None):
if text is not None:
print(text)
def mock_cameras(request, camera_type="all"):
# TODO(rcadene): Redesign the mocking tests
monkeypatch = request.getfixturevalue("monkeypatch")