File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from bluetooth_data_tools import parse_advertisement_data_tuple
1+ from bluetooth_data_tools import (
2+ parse_advertisement_data_bytes ,
3+ parse_advertisement_data_tuple ,
4+ )
25from bluetooth_data_tools .gap import _uncached_parse_advertisement_data
36
47# cythonize -X language_level=3 -a -i src/bluetooth_data_tools/gap.py
@@ -92,8 +95,6 @@ def test_parse_advertisement_data_tuple_uncached(benchmark):
9295
9396
9497def test_parse_advertisement_data_tuple_bytes_cache_fallthrough (benchmark ):
95- from bluetooth_data_tools import parse_advertisement_data_bytes
96-
9798 joined = b"" .join (advs )
9899 parse_advertisement_data_bytes (joined )
99100
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def build(setup_kwargs: Any) -> None:
6363 if os .environ .get ("SKIP_CYTHON" , False ):
6464 return
6565 try :
66- from Cython .Build import cythonize
66+ from Cython .Build import cythonize # noqa: PLC0415
6767
6868 setup_kwargs .update (
6969 dict (
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ extend-select = [
129129 " E" ,
130130 " F" ,
131131 " I" , # isort
132+ " PLC0415" , # import-outside-toplevel
132133 " S" , # security (bandit)
133134 " W" ,
134135 " UP" , # pyupgrade
Original file line number Diff line number Diff line change 11# cythonize -X language_level=3 -a -i src/bluetooth_data_tools/gap.py
22from pytest_codspeed import BenchmarkFixture
33
4- from bluetooth_data_tools import parse_advertisement_data_tuple
4+ from bluetooth_data_tools import (
5+ parse_advertisement_data_bytes ,
6+ parse_advertisement_data_tuple ,
7+ )
58from bluetooth_data_tools .gap import _uncached_parse_advertisement_data
69
710advs = (
@@ -101,8 +104,6 @@ def test_parse_advertisement_data_tuple_bytes_cache_fallthrough(
101104 identity per callback but the joined payload was already parsed (e.g.
102105 same advertisement was seen via the bytes-form helper earlier).
103106 """
104- from bluetooth_data_tools import parse_advertisement_data_bytes
105-
106107 joined = b"" .join (advs )
107108 parse_advertisement_data_bytes (joined )
108109
Original file line number Diff line number Diff line change 11import base64
2+ import logging
23
34import pytest
45
@@ -103,8 +104,6 @@ def test_parse_advertisement_data_trailing_minimum_ad_struct(caplog):
103104 # Manufacturer-data struct (5 bytes) followed by a trailing minimum-AD
104105 # struct [length=1][type=0x09] (2 bytes). The loop must enter the trailing
105106 # struct rather than silently skip it; preceding data must still parse.
106- import logging
107-
108107 data = [b"\x04 \xff \x4c \x00 \x10 \x01 \x09 " ]
109108
110109 with caplog .at_level (logging .DEBUG , logger = "bluetooth_data_tools.gap" ):
You can’t perform that action at this time.
0 commit comments