Skip to content

Commit

Permalink
Modified full cycle test
Browse files Browse the repository at this point in the history
* dataset_variant irrelevant

* test every split
  • Loading branch information
kai-car committed Aug 12, 2024
1 parent 7f654cc commit 81779cb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/dataset_builders/pie/drugprot/test_drugprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,12 @@ def test_document_to_example(document, builder, hf_example):
assert hf_example_back == hf_example


def test_example_to_document_and_back_all(hf_dataset, builder, dataset_variant):
if dataset_variant == "drugprot_source":
for example in hf_dataset["train"]:
def test_example_to_document_and_back_all(hf_dataset, builder):
for ds in hf_dataset.values():
for example in ds:
document = builder._generate_document(example)
example_back = builder._generate_example(document)
assert example_back == example
elif dataset_variant == "drugprot_bigbio_kb":
for example in hf_dataset["train"]:
document = builder._generate_document(example)
example_back = builder._generate_example(document)
assert example_back == example
else:
raise ValueError(f"Unknown dataset variant: {dataset_variant}")


def test_document_converters(builder, dataset_variant):
Expand Down

0 comments on commit 81779cb

Please sign in to comment.