Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): further speed up ot3controller tests and add profiling #12132

Merged
merged 4 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(api): patch out ot3 gpio sleep
The OT3 gpio drivers have a sleep(1) in their init method. This isn't
great, and will soon be removed - it was required for some nasty
interactions between estop initialization and our canbus driver when it
was initializing, and on later revs we don't need to handle the estop
line like this - but in the meantime we can patch it out.

This makes these tests take about a second in total instead of 80 seconds.
  • Loading branch information
sfoster1 committed Feb 10, 2023
commit 2832ba7dca496ce1903f3edfe68b0b8fce05abc6
1 change: 0 additions & 1 deletion api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""
import pytest


# Options must be added at the root level for pytest to properly
# pick them up. Technically, the main conftest that we use in
# tests/opentrons is not the root level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def mock_driver(mock_messenger: AsyncMock) -> AbstractCanDriver:

@pytest.fixture
def controller(mock_config: OT3Config, mock_driver: AbstractCanDriver) -> OT3Controller:
return OT3Controller(mock_config, mock_driver)
with mock.patch("opentrons.hardware_control.backends.ot3controller.OT3GPIO"):
yield OT3Controller(mock_config, mock_driver)


@pytest.fixture
Expand Down