def test_permission_file():
 import tempfile
 from conda.common.compat import text_type
 with tempfile.NamedTemporaryFile(mode='r') as f:
  if (not isinstance(f.name, text_type)):
   return
  with FileLock(f.name) as lock:
   path = basename(lock.lock_file_path)
   assert (not exists(join(f.name, path)))

def test_permission_file ( ) : import tempfile from conda . common . compat import text_type with tempfile . NamedTemporaryFile ( mode = 'r' ) as f : if ( not isinstance ( f . name , text_type ) ) : return with FileLock ( f . name ) as lock : path = basename ( lock . lock_file_path ) assert ( not exists ( join ( f . name , path ) ) )
test when lock cannot be created due to permission make sure no exception raised .