diff --git a/bumble/testing/__init__.py b/bumble/testing/__init__.py new file mode 100644 index 00000000..daaad59c --- /dev/null +++ b/bumble/testing/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2021-2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tests/test_utils.py b/bumble/testing/test_utils.py similarity index 100% rename from tests/test_utils.py rename to bumble/testing/test_utils.py diff --git a/tests/aics_test.py b/tests/aics_test.py index 4d0cdf20..33a8bba1 100644 --- a/tests/aics_test.py +++ b/tests/aics_test.py @@ -32,8 +32,7 @@ Mute, ) from bumble.profiles.vcs import VolumeControlService, VolumeControlServiceProxy - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Tests diff --git a/tests/asha_test.py b/tests/asha_test.py index 97e7e39c..b645f2d8 100644 --- a/tests/asha_test.py +++ b/tests/asha_test.py @@ -20,8 +20,7 @@ from bumble import device as bumble_device from bumble.profiles import asha - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- HI_SYNC_ID = b'\x00\x01\x02\x03\x04\x05\x06\x07' diff --git a/tests/avrcp_test.py b/tests/avrcp_test.py index b2cfb8de..7953352e 100644 --- a/tests/avrcp_test.py +++ b/tests/avrcp_test.py @@ -25,8 +25,7 @@ import pytest from bumble import avc, avctp, avrcp - -from . import test_utils +from bumble.testing import test_utils # ----------------------------------------------------------------------------- diff --git a/tests/bap_test.py b/tests/bap_test.py index d2945f7c..a3b43567 100644 --- a/tests/bap_test.py +++ b/tests/bap_test.py @@ -55,7 +55,7 @@ PublishedAudioCapabilitiesService, PublishedAudioCapabilitiesServiceProxy, ) -from tests.test_utils import TwoDevices, async_barrier +from bumble.testing.test_utils import TwoDevices, async_barrier # ----------------------------------------------------------------------------- # Logging diff --git a/tests/battery_service_test.py b/tests/battery_service_test.py index ed3246bb..5ac4ae33 100644 --- a/tests/battery_service_test.py +++ b/tests/battery_service_test.py @@ -17,8 +17,7 @@ from bumble import device as device_module from bumble.profiles import battery_service - -from . import test_utils +from bumble.testing import test_utils # ----------------------------------------------------------------------------- diff --git a/tests/cap_test.py b/tests/cap_test.py index 9676eda3..c4d49756 100644 --- a/tests/cap_test.py +++ b/tests/cap_test.py @@ -23,8 +23,7 @@ from bumble import device, gatt from bumble.profiles import cap, csip - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Logging diff --git a/tests/csip_test.py b/tests/csip_test.py index 29bfac4b..865ad71e 100644 --- a/tests/csip_test.py +++ b/tests/csip_test.py @@ -25,8 +25,7 @@ from bumble import device from bumble.profiles import csip - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Logging diff --git a/tests/device_test.py b/tests/device_test.py index 77b73f11..3e65dbea 100644 --- a/tests/device_test.py +++ b/tests/device_test.py @@ -54,7 +54,7 @@ ) from bumble.host import DataPacketQueue, Host from bumble.pairing import PairingConfig, PairingDelegate -from .test_utils import TwoDevices, async_barrier +from bumble.testing.test_utils import TwoDevices, async_barrier # ----------------------------------------------------------------------------- # Constants diff --git a/tests/gatt_service_test.py b/tests/gatt_service_test.py index 90b5c911..b5eeb34b 100644 --- a/tests/gatt_service_test.py +++ b/tests/gatt_service_test.py @@ -21,8 +21,7 @@ from bumble import device, gatt from bumble.profiles import gatt_service - -from . import test_utils +from bumble.testing import test_utils # ----------------------------------------------------------------------------- diff --git a/tests/gatt_test.py b/tests/gatt_test.py index 83ca21e4..64cfa7c4 100644 --- a/tests/gatt_test.py +++ b/tests/gatt_test.py @@ -64,8 +64,7 @@ UTF8CharacteristicAdapter, UTF8CharacteristicProxyAdapter, ) - -from .test_utils import Devices, TwoDevices, async_barrier +from bumble.testing.test_utils import Devices, TwoDevices, async_barrier # ----------------------------------------------------------------------------- diff --git a/tests/gmap_test.py b/tests/gmap_test.py index cf1f9d3f..c9709550 100644 --- a/tests/gmap_test.py +++ b/tests/gmap_test.py @@ -29,8 +29,7 @@ UggFeatures, UgtFeatures, ) - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Tests diff --git a/tests/hap_test.py b/tests/hap_test.py index 3e1effca..4647bda3 100644 --- a/tests/hap_test.py +++ b/tests/hap_test.py @@ -25,8 +25,7 @@ from bumble import att, device from bumble.keys import PairingKeys from bumble.profiles import hap - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Logging diff --git a/tests/heart_rate_service_test.py b/tests/heart_rate_service_test.py index 274e329e..70119c1f 100644 --- a/tests/heart_rate_service_test.py +++ b/tests/heart_rate_service_test.py @@ -20,8 +20,7 @@ from bumble import device as device_module from bumble.profiles import heart_rate_service - -from . import test_utils +from bumble.testing import test_utils # ----------------------------------------------------------------------------- diff --git a/tests/hfp_test.py b/tests/hfp_test.py index 7cea3ad6..5b1bbdaa 100644 --- a/tests/hfp_test.py +++ b/tests/hfp_test.py @@ -23,8 +23,7 @@ import pytest_asyncio from bumble import core, hci, hfp, rfcomm - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Logging diff --git a/tests/l2cap_test.py b/tests/l2cap_test.py index 982db66e..aaef46e9 100644 --- a/tests/l2cap_test.py +++ b/tests/l2cap_test.py @@ -26,8 +26,7 @@ import pytest from bumble import core, l2cap - -from .test_utils import TwoDevices, async_barrier +from bumble.testing.test_utils import TwoDevices, async_barrier # ----------------------------------------------------------------------------- # Logging diff --git a/tests/mcp_test.py b/tests/mcp_test.py index 993bd52e..6e5ec3f0 100644 --- a/tests/mcp_test.py +++ b/tests/mcp_test.py @@ -25,7 +25,7 @@ from bumble import device from bumble.profiles import mcp -from tests.test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Logging diff --git a/tests/rfcomm_test.py b/tests/rfcomm_test.py index b9b52648..435dff3c 100644 --- a/tests/rfcomm_test.py +++ b/tests/rfcomm_test.py @@ -30,8 +30,7 @@ find_rfcomm_channels, make_service_sdp_records, ) - -from . import test_utils +from bumble.testing import test_utils _TIMEOUT = 0.1 diff --git a/tests/sdp_test.py b/tests/sdp_test.py index ac7256a8..d572ea44 100644 --- a/tests/sdp_test.py +++ b/tests/sdp_test.py @@ -34,8 +34,7 @@ DataElement, ServiceAttribute, ) - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # pylint: disable=invalid-name diff --git a/tests/self_test.py b/tests/self_test.py index 5285a3f8..3d7dbdc9 100644 --- a/tests/self_test.py +++ b/tests/self_test.py @@ -33,8 +33,7 @@ OobContext, OobLegacyContext, ) - -from .test_utils import TwoDevices, async_barrier +from bumble.testing.test_utils import TwoDevices, async_barrier # ----------------------------------------------------------------------------- # Logging diff --git a/tests/vcp_test.py b/tests/vcp_test.py index 59e64306..a6080812 100644 --- a/tests/vcp_test.py +++ b/tests/vcp_test.py @@ -22,8 +22,7 @@ from bumble import device from bumble.profiles import vcs - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Logging diff --git a/tests/vocs_test.py b/tests/vocs_test.py index 84ca0dd4..d5aab0ce 100644 --- a/tests/vocs_test.py +++ b/tests/vocs_test.py @@ -34,8 +34,7 @@ VolumeOffsetControlServiceProxy, VolumeOffsetState, ) - -from .test_utils import TwoDevices +from bumble.testing.test_utils import TwoDevices # ----------------------------------------------------------------------------- # Tests