def setUp(self): tdir = PersistentTemporaryDirectory() path_to_dictionary.cache_dir = tdir dictionary_name_for_locale.cache_clear() dictionary_for_locale.cache_clear() get_cache_path.cache_clear() is_cache_up_to_date.updated = False
def tearDown(self): dictionary_name_for_locale.cache_clear() dictionary_for_locale.cache_clear() get_cache_path.cache_clear() is_cache_up_to_date.updated = False try: shutil.rmtree(path_to_dictionary.cache_dir) except OSError: pass path_to_dictionary.cache_dir = None