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

Method side_effect_wrapper

tests/cli/test_cli.py:78–84  ·  view source on GitHub ↗

Side effect wrapper to simulate the first call to path.exists to avoid picking up global config

(*args, **kwargs)

Source from the content-addressed store, hash-verified

76 )
77
78 def side_effect_wrapper(*args, **kwargs):
79 """Side effect wrapper to simulate the first call to path.exists to avoid picking up global config"""
80 if side_effect_wrapper.call_count == 0:
81 side_effect_wrapper.call_count += 1
82 return False
83 else:
84 return True
85
86 side_effect_wrapper.call_count = 0
87 mock_path_exists.side_effect = side_effect_wrapper

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected