(self)
| 194 | |
| 195 | class 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) |
nothing calls this directly
no outgoing calls
no test coverage detected