Skip to content

Commit d630355

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0c548e6 commit d630355

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pytest-embedded-arduino/pytest_embedded_arduino/app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import logging
33
import os
4-
from typing import ClassVar
54

65
from pytest_embedded.app import App
76

@@ -50,17 +49,17 @@ def __init__(
5049
def _get_sketch_name(self, build_path: str) -> str:
5150
"""Extract sketch name from binary files in the build directory."""
5251
if not build_path or not os.path.isdir(build_path):
53-
logging.warning(f'No build path found. Using default sketch name "sketch".')
52+
logging.warning('No build path found. Using default sketch name "sketch".')
5453
return 'sketch'
5554

5655
# Look for .ino.bin or .ino.merged.bin files
5756
for filename in os.listdir(build_path):
5857
if filename.endswith('.ino.bin') or filename.endswith('.ino.merged.bin'):
5958
# Extract sketch name (everything before .ino.bin or .ino.merged.bin)
6059
if filename.endswith('.ino.merged.bin'):
61-
return filename[:-len('.ino.merged.bin')]
60+
return filename[: -len('.ino.merged.bin')]
6261
else:
63-
return filename[:-len('.ino.bin')]
62+
return filename[: -len('.ino.bin')]
6463

6564
# If no .ino.bin or .ino.merged.bin files found, raise an error
6665
raise ValueError(f'No .ino.bin or .ino.merged.bin file found in {build_path}')

pytest-embedded-arduino/pytest_embedded_arduino/serial.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ def flash(self) -> None:
5050

5151
try:
5252
esptool.main(
53-
['--chip', self.app.target, 'write-flash', hex(self.app.bootloader_offset), self.app.binary_file, *flash_settings],
53+
[
54+
'--chip',
55+
self.app.target,
56+
'write-flash',
57+
hex(self.app.bootloader_offset),
58+
self.app.binary_file,
59+
*flash_settings,
60+
],
5461
esp=self.esp,
5562
)
5663
except Exception:

0 commit comments

Comments
 (0)