@pytest.fixture(scope='session')
def clean_jedi_cache(request):
 from jedi import settings
 old = settings.cache_directory
 tmp = tempfile.mkdtemp(prefix='jedi-test-')
 settings.cache_directory = tmp
 @request.addfinalizer
 def restore():
  settings.cache_directory = old
  shutil.rmtree(tmp)

@ pytest . fixture ( scope = 'session' ) def clean_jedi_cache ( request ) : from jedi import settings old = settings . cache_directory tmp = tempfile . mkdtemp ( prefix = 'jedi-test-' ) settings . cache_directory = tmp @ request . addfinalizer def restore ( ) : settings . cache_directory = old shutil . rmtree ( tmp )
set jedi .