-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
25 lines (17 loc) · 849 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Configuring pytest fixtures for use in the test suite."""
import pytest
from clipy_hooks.cli import Command
from arduino_hooks.arduino_cli import ArduinoCLI
from arduino_hooks.arduino_lint import ArduinoLint
@pytest.fixture(scope="function")
def arduino_lint() -> ArduinoLint:
"""Create an arduino lint object fixture for testing with."""
return ArduinoLint(["ArduinoLint"]) # Parameter mimics pre-commit argv[0]
@pytest.fixture(scope="function")
def arduino_cli() -> ArduinoCLI:
"""Create an arduino cli object fixture for testing with."""
return ArduinoCLI(["ArduinoCLI", "--fqbn=arduino:avr:nano"])
@pytest.fixture(params=["arduino_lint", "arduino_cli"])
def arduino_tool(request) -> Command:
"""Fixture defining all tools to test against common functionality."""
return request.getfixturevalue(request.param)