Skip to content

Commit

Permalink
minor formatting changes, add long parameters to scan duration test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGerstenberg committed May 2, 2020
1 parent d57166f commit 269e8cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/integrated/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def subtest_runner(test_case: BlatannTestCase):
self.setup(test_case)

for i, params in enumerate(test_params):
param_str = ", ".join("{}={!r}".format(k, v) for k, v in params.items())
param_str = ", ".join(f"{k}={repr(v)}" for k, v in params.items())
subtest_str = f"{tc_name}({param_str})"

with test_case.subTest(**params):
Expand Down
5 changes: 3 additions & 2 deletions tests/integrated/test_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from blatann.gap.advertising import AdvertisingMode
from blatann.gap.advertise_data import AdvertisingData, AdvertisingFlags, AdvertisingPacketType
from blatann.gap.scanning import ScanReport, Scanner, MIN_SCAN_WINDOW_MS, MIN_SCAN_INTERVAL_MS, ScanParameters
from blatann.gap.scanning import MIN_SCAN_WINDOW_MS, MIN_SCAN_INTERVAL_MS, ScanParameters
from blatann.uuid import Uuid16
from blatann.utils import Stopwatch

Expand Down Expand Up @@ -33,7 +33,8 @@ def _get_packets_for_adv(self, results):
scan_response_packets = [p for p in all_packets if p.packet_type == AdvertisingPacketType.scan_response]
return all_packets, adv_packets, scan_response_packets

@TestParams([dict(duration=x) for x in [1, 2, 4, 10]])
@TestParams([dict(duration=x) for x in [1, 2, 4, 10]], long_running_params=
[dict(duration=x) for x in [60, 120]])
def test_scan_duration(self, duration):
acceptable_delta = 0.100
on_timeout_event = threading.Event()
Expand Down

0 comments on commit 269e8cf

Please sign in to comment.