@pytest.fixture(autouse=True)
def isolate(tmpdir):
 home_dir = os.path.join(str(tmpdir), 'home')
 os.makedirs(home_dir)
 fake_root = os.path.join(str(tmpdir), 'fake-root')
 os.makedirs(fake_root)
 os.environ['HOME'] = home_dir
 os.environ['XDG_DATA_HOME'] = os.path.join(home_dir, '.local', 'share')
 os.environ['XDG_CONFIG_HOME'] = os.path.join(home_dir, '.config')
 os.environ['XDG_CACHE_HOME'] = os.path.join(home_dir, '.cache')
 os.environ['XDG_RUNTIME_DIR'] = os.path.join(home_dir, '.runtime')
 os.environ['XDG_DATA_DIRS'] = ':'.join([os.path.join(fake_root, 'usr', 'local', 'share'), os.path.join(fake_root, 'usr', 'share')])
 os.environ['XDG_CONFIG_DIRS'] = os.path.join(fake_root, 'etc', 'xdg')
 os.environ['GIT_CONFIG_NOSYSTEM'] = '1'
 os.environ['GIT_AUTHOR_NAME'] = 'pip'
 os.environ['GIT_AUTHOR_EMAIL'] = 'pypa-dev@googlegroups.com'
 os.environ['PIP_DISABLE_PIP_VERSION_CHECK'] = 'true'
 os.makedirs(os.path.join(home_dir, '.config', 'git'))
 with open(os.path.join(home_dir, '.config', 'git', 'config'), 'wb') as fp:
  fp.write('[user]\n DCTB name = pip\n DCTB email = pypa-dev@googlegroups.com\n')

@ pytest . fixture ( autouse = True ) def isolate ( tmpdir ) : home_dir = os . path . join ( str ( tmpdir ) , 'home' ) os . makedirs ( home_dir ) fake_root = os . path . join ( str ( tmpdir ) , 'fake-root' ) os . makedirs ( fake_root ) os . environ [ 'HOME' ] = home_dir os . environ [ 'XDG_DATA_HOME' ] = os . path . join ( home_dir , '.local' , 'share' ) os . environ [ 'XDG_CONFIG_HOME' ] = os . path . join ( home_dir , '.config' ) os . environ [ 'XDG_CACHE_HOME' ] = os . path . join ( home_dir , '.cache' ) os . environ [ 'XDG_RUNTIME_DIR' ] = os . path . join ( home_dir , '.runtime' ) os . environ [ 'XDG_DATA_DIRS' ] = ':' . join ( [ os . path . join ( fake_root , 'usr' , 'local' , 'share' ) , os . path . join ( fake_root , 'usr' , 'share' ) ] ) os . environ [ 'XDG_CONFIG_DIRS' ] = os . path . join ( fake_root , 'etc' , 'xdg' ) os . environ [ 'GIT_CONFIG_NOSYSTEM' ] = '1' os . environ [ 'GIT_AUTHOR_NAME' ] = 'pip' os . environ [ 'GIT_AUTHOR_EMAIL' ] = 'pypa-dev@googlegroups.com' os . environ [ 'PIP_DISABLE_PIP_VERSION_CHECK' ] = 'true' os . makedirs ( os . path . join ( home_dir , '.config' , 'git' ) ) with open ( os . path . join ( home_dir , '.config' , 'git' , 'config' ) , 'wb' ) as fp : fp . write ( '[user]\n DCTB name = pip\n DCTB email = pypa-dev@googlegroups.com\n' )
give a rational isolating interval for an algebraic number .