MCPcopy Index your code
hub / github.com/huggingface/datasets / test_load_dataset_from_hub

Method test_load_dataset_from_hub

tests/test_load.py:745–766  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

743 self.assertIn("Using the latest cached version of the dataset", self._caplog.text)
744
745 def test_load_dataset_from_hub(self):
746 with self.assertRaises(DatasetNotFoundError) as context:
747 datasets.load_dataset("_dummy")
748 self.assertIn(
749 "Dataset '_dummy' doesn't exist on the Hub",
750 str(context.exception),
751 )
752 with self.assertRaises(DatasetNotFoundError) as context:
753 datasets.load_dataset("HuggingFaceFW/fineweb-edu", revision="0.0.0")
754 self.assertIn(
755 "Revision '0.0.0' doesn't exist for dataset 'HuggingFaceFW/fineweb-edu' on the Hub.",
756 str(context.exception),
757 )
758 for offline_simulation_mode in list(OfflineSimulationMode):
759 with offline(offline_simulation_mode):
760 with self.assertRaises(ConnectionError) as context:
761 datasets.load_dataset("_dummy")
762 if offline_simulation_mode != OfflineSimulationMode.HF_HUB_OFFLINE_SET_TO_1:
763 self.assertIn(
764 "Couldn't reach '_dummy' on the Hub",
765 str(context.exception),
766 )
767
768 @pytest.mark.integration
769 def test_load_dataset_invalid_revision_with_cache(self):

Callers

nothing calls this directly

Calls 1

offlineFunction · 0.85

Tested by

no test coverage detected