rather than a fake file, you can just replace `global_state` with a regular dict