jupyter_core
jupyter_core copied to clipboard
Test failure on OpenBSD
I'm testing version 4.0.6.
Looks like a directory has not been created:
> /usr/local/bin/py.test /usr/local/lib/python2.7/site-packages/jupyter_core/tests/
============================= test session starts ==============================
platform openbsd5 -- Python 2.7.10 -- py-1.4.23 -- pytest-2.6.1
collected 38 items
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_application.py ......
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_command.py .........
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_migrate.py .......F
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_paths.py ...............
=================================== FAILURES ===================================
_________________________________ test_migrate _________________________________
env = {'IPYTHONDIR': '/tmp/tmpon3PGZ/ipython', 'JUPYTER_CONFIG_DIR': '/tmp/tmpon3PGZ/jupyter', 'JUPYTER_DATA_DIR': '/tmp/tmpon3PGZ/jupyter_data', 'JUPYTER_PATH': '', ...}
def test_migrate(env):
shutil.copytree(dotipython, env['IPYTHONDIR'])
> migrate()
/usr/local/lib/python2.7/site-packages/jupyter_core/tests/test_migrate.py:215:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/site-packages/jupyter_core/migrate.py:227: in migrate
if migrate_config(name, env):
/usr/local/lib/python2.7/site-packages/jupyter_core/migrate.py:202: in migrate_config
if migrate_file(src, dst, substitutions=config_substitutions):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src = '/tmp/tmpon3PGZ/ipython/profile_default/ipython_notebook_config.py'
dst = '/tmp/tmpon3PGZ/jupyter/jupyter_notebook_config.py'
substitutions = {<_sre.SRE_Pattern object at 0xb9d38a59030>: 'JupyterQtConsoleApp', <_sre.SRE_Pattern object at 0xb9d9e1d0200>: 'Jupyt...RE_Pattern object at 0xb9db2f3e660>: 'RichJupyterWidget', <_sre.SRE_Pattern object at 0xb9db2f3e768>: 'nbconvert', ...}
def migrate_file(src, dst, substitutions=None):
"""Migrate a single file from src to dst
substitutions is an optional dict of {regex: replacement} for performing replacements on the file.
"""
log = get_logger()
if os.path.exists(dst):
# already exists
log.debug("%s already exists" % dst)
return False
log.info("Copying %s -> %s" % (src, dst))
ensure_dir_exists(os.path.dirname(dst))
shutil.copy(src, dst)
if substitutions:
with open(dst) as f:
text = f.read()
for pat, replacement in substitutions.items():
text = pat.sub(replacement, text)
> with open(dst, 'w') as f:
f.write(text)
E IOError: [Errno 13] Permission denied: '/tmp/tmpon3PGZ/jupyter/jupyter_notebook_config.py'
/usr/local/lib/python2.7/site-packages/jupyter_core/migrate.py:110: IOError
===================== 1 failed, 37 passed in 1.83 seconds ======================
> ls -al /tmp/tmpon3PGZ/jupyter/
ls: /tmp/tmpon3PGZ/jupyter/: No such file or directory
> ls -al /tmp/tmpon3PGZ
ls: /tmp/tmpon3PGZ: No such file or directory
Looks like something is wrong in permissions. I'll see if I can figure out what BSD does differently.