Skip to content

Commit 4eaa344

Browse files
committed
Convert test framework to pytest and update vscode-settings for pytest
1 parent 96f6b58 commit 4eaa344

File tree

6 files changed

+512
-673
lines changed

6 files changed

+512
-673
lines changed

.vscode/settings.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@
1111
"SQNHTTPSND"
1212
],
1313
"C_Cpp.clang_format_fallbackStyle": "{ IndentWidth: 4, AllowShortLoopsOnASingleLine: true, AllowShortBlocksOnASingleLine: true, ColumnLimit: 80, BinPackParameters: false, BinPackArguments: false, AllowAllParametersOfDeclarationOnNextLine: false, AlignConsecutiveMacros: true, FixNamespaceComments: false, NamespaceIndentation: All, AlignConsecutiveAssignments: true, AlignEscapedNewlines: true, AlignOperands: Align, AlignTrailingComments: true, AllowAllParametersOfDeclarationOnNextLine: false, AllowAllArgumentsOnNextLine: false, PenaltyBreakAssignment: 50, PointerAlignment: Left, ReferenceAlignment: Left }",
14-
"files.associations": {
15-
"*.cfgmap": "xml",
16-
"led_ctrl.h": "c"
17-
},
18-
"workbench.colorCustomizations": {
19-
"activityBar.background": "#4D1C30",
20-
"titleBar.activeBackground": "#6C2843",
21-
"titleBar.activeForeground": "#FEFCFD"
22-
}
23-
}
14+
"python.testing.pytestArgs": [
15+
"--port=COM7",
16+
"--ignore=lib"
17+
],
18+
"python.testing.unittestEnabled": false,
19+
"python.testing.pytestEnabled": true
20+
}

test/conftest.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import os
22

3+
from pathlib import Path
4+
5+
36
def pytest_addoption(parser):
47

58
file_directory = os.path.dirname(os.path.realpath(__file__))
69

7-
# TODO: fix proper pathing
8-
sketch_dir = f"{file_directory}/../examples"
9-
build_dir = f"{file_directory}/build"
10-
10+
sketch_dir = Path(f"{file_directory}/../examples")
11+
build_dir = Path(f"{file_directory}/build")
1112

1213
parser.addoption("--port", action="store", help="Device port (COMx, /dev/ttyACMx, etc.)", required=True)
1314
parser.addoption("--device", action="store", help="Device to test against", default="avr128db48")
14-
parser.addoption("--logging", action="store", help="Logging verbosity level (critical, error, warning, info, debug)", default="warn")
15-
parser.addoption("--sketchdir", action="store", help="Relative path to the sketch directory with the example sketches", default=sketch_dir)
15+
parser.addoption("--sketchdir", action="store",
16+
help="Relative path to the sketch directory with the example sketches", default=sketch_dir)
1617
parser.addoption("--builddir", action="store", help="Relative path to the build directory", default=build_dir)

test/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pymcuprog
2-
pyserial
2+
pyserial
3+
pathlib

test/test.py

Lines changed: 0 additions & 266 deletions
This file was deleted.

0 commit comments

Comments
 (0)