Skip to content

Commit

Permalink
change: switch to new test data loader
Browse files Browse the repository at this point in the history
  • Loading branch information
ssato committed May 6, 2024
1 parent cc4f487 commit 96a8f1e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions tests/api/open/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@
import anyconfig.api._open as TT
import anyconfig.api._load as LD

from ...common import tdc
from ... import common

if typing.TYPE_CHECKING:
import pathlib


DATASETS: list[tuple[pathlib.Path, typing.Optional[dict], dict]] = [
pytest.param(
ipath, data.get("e", None), data.get("o", {}),
id=f"{ipath.parent}/{ipath.name}"
)
for ipath, data
in tdc.collect_for("open", "basics", subdir="api", load=False)
]
NAMES: tuple[str, ...] = ("ipath", "exp", "opts")
DATA: list[
tuple[pathlib.Path, typing.Optional[dict], dict]
] = common.load_data_for_testfile(__file__, values=(("e", None), ("o", {})))

DATA_IDS: list[str] = common.get_test_ids(DATA)

@pytest.mark.parametrize(("ipath", "exp", "opts"), DATASETS)

@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS)
def test_open_text_io(ipath, exp, opts):
with TT.open(ipath, **opts) as inp:
assert LD.load(inp, **opts) == exp
Expand Down

0 comments on commit 96a8f1e

Please sign in to comment.