| 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): |