@contextlib.contextmanager
def PatchFlags(mock_flags=None):
  mock_flags = mock_flags or MockFlags()
  with flag_util.FlagDictSubstitution(FLAGS, mock_flags.FlagDict):
    yield mock_flags
Patches read and write access to perfkitbenchmarker.flags.FLAGS.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/tests/mock_flags.py/PatchFlags