Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the correct fixtures in tests #428

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions tests/examples/test_wds_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def webdataset_metadata(tmp_path):
return metadata_path


def test_wds(catalog, webdataset_tars):
res = DataChain.from_storage(Path(webdataset_tars).as_uri()).gen(
laion=process_webdataset(spec=WDSLaion), params="file"
)
def test_wds(test_session, webdataset_tars):
res = DataChain.from_storage(
Path(webdataset_tars).as_uri(), session=test_session
).gen(laion=process_webdataset(spec=WDSLaion), params="file")

num_rows = 0
for laion_wds in res.collect("laion"):
Expand All @@ -95,10 +95,12 @@ def test_wds(catalog, webdataset_tars):
assert num_rows == len(WDS_TAR_SHARDS)


def test_wds_merge_with_parquet_meta(catalog, webdataset_tars, webdataset_metadata):
wds = DataChain.from_storage(Path(webdataset_tars).as_uri()).gen(
laion=process_webdataset(spec=WDSLaion), params="file"
)
def test_wds_merge_with_parquet_meta(
test_session, webdataset_tars, webdataset_metadata
):
wds = DataChain.from_storage(
Path(webdataset_tars).as_uri(), session=test_session
).gen(laion=process_webdataset(spec=WDSLaion), params="file")

meta = DataChain.from_parquet(Path(webdataset_metadata).as_uri())

Expand Down
4 changes: 2 additions & 2 deletions tests/func/test_datachain.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ def test_from_storage_check_rows(tmp_dir, test_session):
)


def test_mutate_existing_column(catalog):
ds = DataChain.from_values(ids=[1, 2, 3])
def test_mutate_existing_column(test_session):
ds = DataChain.from_values(ids=[1, 2, 3], session=test_session)

with pytest.raises(DataChainColumnError) as excinfo:
ds.mutate(ids=Column("ids") + 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def run_step(step):


@pytest.mark.e2e
def test_cli_e2e(tmp_dir, catalog):
def test_cli_e2e(tmp_dir, catalog_tmpfile):
"""End-to-end CLI Test"""
for step in E2E_STEPS:
run_step(step)
2 changes: 1 addition & 1 deletion tests/test_query_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def run_step(step): # noqa: PLR0912


@pytest.mark.e2e
def test_query_e2e(tmp_dir, catalog):
def test_query_e2e(tmp_dir, catalog_tmpfile):
"""End-to-end CLI Query Test"""
for step in E2E_STEPS:
run_step(step)
Expand Down
Loading