MCPcopy Create free account
hub / github.com/huggingface/evaluate / test_CachedMetricModuleFactory

Method test_CachedMetricModuleFactory

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

Source from the content-addressed store, hash-verified

101 assert importlib.import_module(module_factory_result.module_path) is not None
102
103 def test_CachedMetricModuleFactory(self):
104 path = os.path.join(self._metric_loading_script_dir, f"{METRIC_LOADING_SCRIPT_NAME}.py")
105 factory = LocalEvaluationModuleFactory(
106 path, download_config=self.download_config, dynamic_modules_path=self.dynamic_modules_path
107 )
108 module_factory_result = factory.get_module()
109 for offline_mode in OfflineSimulationMode:
110 with offline(offline_mode):
111 factory = CachedEvaluationModuleFactory(
112 METRIC_LOADING_SCRIPT_NAME,
113 dynamic_modules_path=self.dynamic_modules_path,
114 )
115 module_factory_result = factory.get_module()
116 assert importlib.import_module(module_factory_result.module_path) is not None
117
118 def test_cache_with_remote_canonical_module(self):
119 metric = "accuracy"

Callers

nothing calls this directly

Calls 4

get_moduleMethod · 0.95
offlineFunction · 0.85

Tested by

no test coverage detected