Skip to content

Commit 254824d

Browse files
committed
Add documentation for conftest and update some assert logging
1 parent cbf0229 commit 254824d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
from pathlib import Path
44

5-
65
def pytest_addoption(parser):
6+
"""Sets up the arguments which are passed to the tests
7+
8+
Args:
9+
parser (obj): PyTest parser object
10+
"""
711

812
file_directory = os.path.dirname(os.path.realpath(__file__))
913

test/test_examples.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def program(request, backend):
415415
compilation_return_code = subprocess.run(
416416
["arduino-cli", "compile", f"{sketch_path}", "-b", f"{BOARD_CONFIG}", "--output-dir", f"{build_directory}"], shell=True).returncode
417417

418-
assert compilation_return_code == 0, "{example_name} failed to compile"
418+
assert compilation_return_code == 0, f"{example_name} failed to compile"
419419

420420
hex_file = build_directory / f"{os.path.basename(sketch_path)}.hex"
421421

@@ -427,7 +427,7 @@ def program(request, backend):
427427
backend.write_memory(segment.data, memory_name, segment.offset)
428428
verify_ok = backend.verify_memory(segment.data, memory_name, segment.offset)
429429

430-
assert verify_ok, "Verification of memory failed"
430+
assert verify_ok, "Verification of program memory failed"
431431

432432

433433
def run_example(request, backend, example_test_data):
@@ -540,6 +540,5 @@ def test_power_print_voltage(request, backend, session_config, example_test_data
540540
def test_power_save(request, backend, session_config, example_test_data):
541541
run_test(request, backend, session_config, example_test_data)
542542

543-
544543
def test_sandbox(request, backend, session_config, example_test_data):
545544
run_test(request, backend, session_config, example_test_data)

0 commit comments

Comments
 (0)