def _check_benchmark_hooks_environment(self, context):
environment = self.expected_env[context.benchmark]<EOL>for hook_file_prefix in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>hook_file = osp.join(context.path, hook_file_prefix + '<STR_LIT>')<EOL>with open(hook_file) as istr:<EOL><INDENT>hook_env = yaml.safe_load(istr)<EOL><DEDENT>for var, value in environment['<STR_LIT>'].items():<EOL><INDENT>self.assertEqual(hook_env[var], value)<EOL>hook_env.pop(var)<EOL><DEDENT>for module in environment['<STR_LIT>']:<EOL><INDENT>var = EnvBenchmark.MODULE_TO_VAR_RE.sub('<STR_LIT:_>', module)<EOL>self.assertEqual(hook_env[var], '<STR_LIT>')<EOL><DEDENT><DEDENT>
Check hook file written by benchmark
        `pre_execute` and `post_execute` member methods