Skip to content

Commit c8f9e65

Browse files
chore: Update test dependencies in Python projects (#18581)
1 parent ced0e9e commit c8f9e65

File tree

56 files changed

+2440
-2451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2440
-2451
lines changed

api/Pipfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ colorama = { version = "==0.4.4", markers="sys_platform=='win32'" }
2828
coverage = "==7.4.1"
2929
mypy = "==1.11.0"
3030
numpydoc = "==0.9.1"
31-
pytest = "==7.4.4"
32-
pytest-asyncio = "~=0.23.0"
31+
pytest = "<9,>=8"
32+
pytest-asyncio = "<2,>=0.23.0"
3333
pytest-cov = "==4.1.0"
34-
pytest-lazy-fixture = "==0.6.3"
3534
pytest-xdist = "~=2.5.0"
3635
sphinx = "==5.0.1"
3736
twine = "==4.0.0"
@@ -45,7 +44,7 @@ flake8 = "==7.0.0"
4544
flake8-annotations = "~=3.0.1"
4645
flake8-docstrings = "~=1.7.0"
4746
flake8-noqa = "~=1.4.0"
48-
decoy = "==2.1.1"
47+
decoy = "<3,>=2.2.0"
4948
black = "==22.3.0"
5049
types-mock = "~=5.1.0"
5150
types-setuptools = "==57.0.2"
@@ -54,5 +53,6 @@ typing-extensions = ">=4.0.0,<5"
5453
pytest-profiling = "~=1.7.0"
5554
# TODO(mc, 2022-03-31): upgrade sphinx, remove this subdep pin
5655
jinja2 = ">=2.3,<3.1"
57-
hypothesis = "==6.96.1"
56+
hypothesis = "<7,>=6.96.1"
5857
build = "~=1.2.0"
58+
pytest-lazy-fixtures = "<2,>=1.1.4"

api/Pipfile.lock

Lines changed: 67 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/pytest.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ addopts = -m "not stackup_testing" --color=yes --strict-markers
88
asyncio_mode = auto
99

1010
filterwarnings =
11-
# TODO this should be looked into being removed upon updating the Decoy library. The purpose of this warning is to
12-
# catch missing attributes, but it raises for any property referenced in a test which accounts for about ~250 warnings
13-
# which aren't serving any useful purpose and obscure other warnings.
14-
ignore::decoy.warnings.MissingSpecAttributeWarning
1511
# Pydantic's shims for its legacy v1 methods (e.g. `BaseModel.construct()`)
1612
# are not type-checked properly. Forbid them, so we're forced to use their newer
1713
# v2 replacements which are type-checked (e.g. ``BaseModel.model_construct()`)

api/tests/opentrons/config/test_advanced_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from pytest_lazyfixture import lazy_fixture # type: ignore[import-untyped]
2+
from pytest_lazy_fixtures import lf as lazy_fixture
33
from typing import Dict, Generator, Optional
44
from unittest.mock import MagicMock, patch
55

api/tests/opentrons/config/test_advanced_settings_migration.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44
from _pytest.fixtures import SubRequest
5-
from pytest_lazyfixture import lazy_fixture # type: ignore[import-untyped]
5+
from pytest_lazy_fixtures import lf as lazy_fixture
66
from opentrons.config.advanced_settings import _migrate, _ensure
77

88

@@ -439,7 +439,6 @@ def v37_config(v36_config: Dict[str, Any]) -> Dict[str, Any]:
439439

440440

441441
@pytest.fixture(
442-
scope="session",
443442
params=[
444443
lazy_fixture("empty_settings"),
445444
lazy_fixture("version_less"),

api/tests/opentrons/conftest.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
)
8686

8787
from opentrons import config
88-
from opentrons import hardware_control as hc
8988
from opentrons.drivers.rpi_drivers.gpio_simulator import SimulatingGPIOCharDev
9089
from opentrons.hardware_control import (
9190
API,
@@ -426,19 +425,6 @@ def hardware_controller_lockfile(
426425
return lockfile_dir
427426

428427

429-
@pytest.mark.skipif(
430-
not hc.Controller,
431-
reason="hardware controller not available (probably windows)",
432-
)
433-
@pytest.fixture()
434-
def cntrlr_mock_connect(monkeypatch: pytest.MonkeyPatch) -> None:
435-
async def mock_connect(obj: object, port: Any = None) -> None:
436-
return
437-
438-
monkeypatch.setattr(hc.Controller, "connect", mock_connect)
439-
monkeypatch.setattr(hc.Controller, "fw_version", "virtual")
440-
441-
442428
@pytest.fixture()
443429
async def hardware_api(is_robot: None) -> HardwareControlAPI:
444430
hw_api = await API.build_hardware_simulator(loop=asyncio.get_running_loop())

api/tests/opentrons/hardware_control/backends/test_ot3_estop_state.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
)
1717

1818

19-
@pytest.mark.ot3_only
2019
@pytest.fixture
2120
def initial_state() -> "EstopSummary":
2221
return EstopSummary(left_detected=True, right_detected=True, engaged=False)
2322

2423

25-
@pytest.mark.ot3_only
2624
@pytest.fixture
2725
def mock_estop_detector(decoy: Decoy, initial_state: "EstopSummary") -> "EstopDetector":
2826
"""Create a mocked estop detector."""
@@ -31,7 +29,6 @@ def mock_estop_detector(decoy: Decoy, initial_state: "EstopSummary") -> "EstopDe
3129
return mock
3230

3331

34-
@pytest.mark.ot3_only
3532
@pytest.fixture
3633
def subject(mock_estop_detector: "EstopDetector") -> "EstopStateMachine":
3734
return EstopStateMachine(detector=mock_estop_detector)

api/tests/opentrons/hardware_control/instruments/test_instrument_calibration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Union, cast
44

55
import pytest
6-
from pytest_lazyfixture import lazy_fixture # type: ignore[import-untyped]
6+
from pytest_lazy_fixtures import lf as lazy_fixture
77
from decoy import Decoy
88

99
from opentrons_shared_data.labware.types import (

api/tests/opentrons/hardware_control/test_gripper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
fake_gripper_conf = gripper_config.load(GripperModel.v1)
2020

2121

22-
@pytest.mark.ot3_only
2322
@pytest.fixture
2423
def fake_offset() -> GripperCalibrationOffset:
2524

api/tests/opentrons/hardware_control/test_pipette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from opentrons_shared_data.errors.exceptions import InvalidLiquidClassName
66
from opentrons.calibration_storage import types as cal_types
77
from opentrons.types import Point, Mount
8-
from pytest_lazyfixture import lazy_fixture # type: ignore[import-untyped]
8+
from pytest_lazy_fixtures import lf as lazy_fixture
99
from opentrons.hardware_control.instruments.ot2 import (
1010
pipette as ot2_pipette,
1111
instrument_calibration,

0 commit comments

Comments
 (0)