Skip to content

tests are not passing on the master branch (6bef5ce656bc22808c60da226d36f561f10e543c) on ubuntu #171

@EasyRiderr

Description

@EasyRiderr

Tests are not passing on the master branch

Tests should always pass on the master branch.

Reproduction

On Ubuntu, clone the bless repo. On the master branch with the latest commit: 6bef5ce, run tests:

TEST_HARDWARE=True python -m pytest -s

Below are the results:

================================================================== test session starts ===================================================================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/user/Documents/bless
configfile: pytest.ini
plugins: asyncio-1.3.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collecting ... 2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
collected 15 items / 2 skipped                                                                                                                           

test/backends/bluezdbus/test_application.py 2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
F
test/backends/bluezdbus/test_utils.py 2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
.
test/backends/test_server.py s
test/backends/test_server_multiclient.py s
test/test_bleak_v1_compatibility.py 2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
.2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
..2026-01-20 11:47:41 asyncio[97711] DEBUG Using selector: EpollSelector
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
2026-01-20 11:47:41 bless.backends.characteristic[97711] DEBUG With on_read: None
.
test/test_init.py .

======================================================================== FAILURES ========================================================================
___________________________________________________________ TestBlueZGattApplication.test_init ___________________________________________________________

self = <test_application.TestBlueZGattApplication object at 0x72fb3c986b10>

    @pytest.mark.asyncio
    async def test_init(self):
    
        def read(char: BlueZGattCharacteristic) -> bytes:
            return bytes(self.val)
    
        def write(char: BlueZGattCharacteristic, value: bytes):
            char._value = bytes(value)  # type: ignore
            self.val = bytearray(value)
    
        def notify(char: BlueZGattCharacteristic):
            return
    
        def stop_notify(char: BlueZGattCharacteristic):
            return
    
        bus: MessageBus = await MessageBus(bus_type=BusType.SYSTEM).connect()
    
        # Create the app
>       app: BlueZGattApplication = BlueZGattApplication(
            "ble", "org.bluez", bus
        )
E       TypeError: BlueZGattApplication.__init__() missing 4 required positional arguments: 'on_read', 'on_write', 'on_subscribe', and 'on_unsubscribe'

test/backends/bluezdbus/test_application.py:56: TypeError
------------------------------------------------------------------- Captured log setup -------------------------------------------------------------------
DEBUG    asyncio:selector_events.py:64 Using selector: EpollSelector
==================================================================== warnings summary ====================================================================
../../Downloads/env/bless/lib/python3.12/site-packages/_pytest/config/__init__.py:1428
  /home/user/Downloads/env/bless/lib/python3.12/site-packages/_pytest/config/__init__.py:1428: PytestConfigWarning: Unknown config option: timeout
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

bless/backends/bluezdbus/dbus/session.py:28
  /home/user/Documents/bless/bless/backends/bluezdbus/dbus/session.py:28: DeprecationWarning: There is no current event loop
    loop: asyncio.AbstractEventLoop = asyncio.get_event_loop(),

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================ short test summary info =================================================================
FAILED test/backends/bluezdbus/test_application.py::TestBlueZGattApplication::test_init - TypeError: BlueZGattApplication.__init__() missing 4 required positional arguments: 'on_read', 'on_write', 'on_subscribe', and 'on_unsubscribe'
================================================== 1 failed, 12 passed, 4 skipped, 2 warnings in 0.22s ===================================================

Expected behavior

None of the tests should fail.

Desktop (please complete the following information):

  • OS: Linux

Additional context
I wanted to try fixing issue #142 and launched tests as a starting point.
By fixing the test missing BlueZGattApplication parameters, more errors are raised, and the app.is_connected() method doesn't work anymore.

Metadata

Metadata

Assignees

Labels

backend: bluezProblem specific to bluezbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions