Skip to content

Commit c105d0f

Browse files
committed
Use type hinting in integration test code
1 parent ed69697 commit c105d0f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: test/test_all.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import json
1616
import pathlib
1717
import platform
18+
import typing
1819

1920
import dateutil.parser
2021
import invoke.context
@@ -178,7 +179,7 @@ def test_version(run_command):
178179

179180

180181
@pytest.fixture(scope="function")
181-
def run_command(pytestconfig, working_dir):
182+
def run_command(pytestconfig, working_dir) -> typing.Callable[..., invoke.runners.Result]:
182183
"""Provide a wrapper around invoke's `run` API so that every test will work in the same temporary folder.
183184
184185
Useful reference:
@@ -187,7 +188,11 @@ def run_command(pytestconfig, working_dir):
187188

188189
arduino_lint_path = pathlib.Path(pytestconfig.rootdir).parent / "arduino-lint"
189190

190-
def _run(cmd, custom_working_dir=None, custom_env=None):
191+
def _run(
192+
cmd: list,
193+
custom_working_dir: typing.Optional[str] = None,
194+
custom_env: typing.Optional[dict] = None
195+
) -> invoke.runners.Result:
191196
if cmd is None:
192197
cmd = []
193198
if not custom_working_dir:
@@ -214,7 +219,7 @@ def _run(cmd, custom_working_dir=None, custom_env=None):
214219

215220

216221
@pytest.fixture(scope="function")
217-
def working_dir(tmpdir_factory):
222+
def working_dir(tmpdir_factory) -> str:
218223
"""Create a temporary folder for the test to run in. It will be created before running each test and deleted at the
219224
end. This way all the tests work in isolation.
220225
"""

0 commit comments

Comments
 (0)