Fix linter failures

This commit is contained in:
Lucian Petrut
2026-09-09 08:43:42 +00:00
parent 2c8580d750
commit f64c753d9c
12 changed files with 165 additions and 136 deletions
+11 -9
View File
@@ -43,15 +43,17 @@ def _time_write_read(
read_buf = module.get_buffer(len(payload))
write_buf[: len(payload)] = payload
kwargs = lab.vixdisklib_connect_kwargs(_connect_extra(lab, module, transport_mode))
with handle.connect(**kwargs) as conn:
with handle.open(conn, lab.disk_path, flags=flags) as disk:
started = time.perf_counter()
handle.write(disk, 0, n_sectors, write_buf)
write_s = time.perf_counter() - started
read_buf[: len(payload)] = b"\xa5" * len(payload)
started = time.perf_counter()
handle.read(disk, 0, n_sectors, read_buf)
read_s = time.perf_counter() - started
with (
handle.connect(**kwargs) as conn,
handle.open(conn, lab.disk_path, flags=flags) as disk,
):
started = time.perf_counter()
handle.write(disk, 0, n_sectors, write_buf)
write_s = time.perf_counter() - started
read_buf[: len(payload)] = b"\xa5" * len(payload)
started = time.perf_counter()
handle.read(disk, 0, n_sectors, read_buf)
read_s = time.perf_counter() - started
assert read_buf.raw[: len(payload)] == payload
return write_s, read_s