MCPcopy Create free account
hub / github.com/mlco2/codecarbon / setup_method

Method setup_method

tests/test_gpu.py:196–204  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

194
195class TestGpuTracking:
196 def setup_method(self):
197 for module_name in list(sys.modules.keys()):
198 if module_name.startswith("codecarbon.core.gpu"):
199 sys.modules.pop(module_name, None)
200 import codecarbon.core
201
202 for attr in ["gpu", "gpu_nvidia", "gpu_amd", "gpu_device"]:
203 if hasattr(codecarbon.core, attr):
204 delattr(codecarbon.core, attr)
205
206 @mock.patch("codecarbon.core.gpu.is_rocm_system", return_value=True)
207 @mock.patch("codecarbon.core.gpu.is_nvidia_system", return_value=False)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected