Skip to content

Commit

Permalink
change: allow passing datadir to tests.common.load_data_for_testfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ssato committed May 20, 2024
1 parent a7ef11c commit f0f4033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/common/tdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@ def load_data_for_testfile(
testfile: str,
values: tuple[tuple[str, typing.Optional[dict], ...], ...] = VALUES,
load_idata: bool = False,
datadir: typing.Optional[pathlib.Path] = None,
**opts
) -> list[tuple[pathlib.Path, dict[str, typing.Any], ...]]:
"""Collct test data for test file, ``testfile``.
:param testfile: a str represents test file path
:param opts: keyword options for `get_test_resdir`
"""
datadir = get_test_resdir(testfile, **opts)
if datadir is None:
datadir = get_test_resdir(testfile, **opts)

if load_idata:
return [
(ipath, idata, *[aux.get(k, v) for k, v in values])
Expand Down

0 comments on commit f0f4033

Please sign in to comment.