Changing a global variable seems like a bad idea for debugging. Can you simply start this function with `expected = set(EXPECTED_TEXTS)`?