Global variables with mutable values could introduce side-effects, but if the elements of your 'global' dictionary don't change between before and after the execution of the pharaohs_revenge function, that's fine.
However, if your dictionary is empty at the beginning of the test run, you need to clear the data in it at the end.