Skip to content

Commit

Permalink
pylint and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Jun 30, 2019
1 parent 80c6de6 commit 872c658
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions jupytext/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ def writef_git_add(notebook_, nb_file_, fmt_):
if args.execute:
log("[jupytext] Executing notebook")
kernel_name = notebook.metadata.get('kernelspec', {}).get('name')
ep = ExecutePreprocessor(timeout=None, kernel_name=kernel_name)
ep.preprocess(notebook, resources={})
exec_proc = ExecutePreprocessor(timeout=None, kernel_name=kernel_name)
exec_proc.preprocess(notebook, resources={})

# III. ### Possible actions ###
modified = args.update_metadata or args.pipe or args.execute
Expand Down
4 changes: 2 additions & 2 deletions jupytext/jupytext.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def create_prefix_dir(nb_file, fmt):
os.makedirs(nb_dir)


def readf(nb_file, fmt=None):
def readf(nb_file, fmt=None): # pragma: no cover
"""Read a notebook from the file with given name"""
warnings.warn(
"readf is deprecated. Please use read instead, and pass the fmt "
Expand All @@ -322,7 +322,7 @@ def readf(nb_file, fmt=None):
return read(fp=nb_file, fmt=fmt)


def writef(notebook, nb_file, fmt=None):
def writef(notebook, nb_file, fmt=None): # pragma: no cover
"""Write a notebook to the file with given name"""
warnings.warn(
'writef is deprecated. Please use write instead, and pass the fmt '
Expand Down
8 changes: 0 additions & 8 deletions tests/test_contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,6 @@ def test_preferred_formats_read_auto(tmpdir):
def test_save_in_auto_extension_global(nb_file, tmpdir):
# load notebook
nb = jupytext.read(nb_file)
if 'language_info' not in nb.metadata:
return

auto_ext = auto_ext_from_metadata(nb.metadata)
tmp_ipynb = 'notebook.ipynb'
Expand Down Expand Up @@ -781,8 +779,6 @@ def test_global_auto_pairing_works_with_empty_notebook(tmpdir):
def test_save_in_auto_extension_global_with_format(nb_file, tmpdir):
# load notebook
nb = jupytext.read(nb_file)
if 'language_info' not in nb.metadata:
return

auto_ext = auto_ext_from_metadata(nb.metadata)
tmp_ipynb = 'notebook.ipynb'
Expand Down Expand Up @@ -814,8 +810,6 @@ def test_save_in_auto_extension_local(nb_file, tmpdir):
# load notebook
nb = jupytext.read(nb_file)
nb.metadata.setdefault('jupytext', {})['formats'] = 'ipynb,auto:percent'
if 'language_info' not in nb.metadata:
return

auto_ext = auto_ext_from_metadata(nb.metadata)
tmp_ipynb = 'notebook.ipynb'
Expand All @@ -842,8 +836,6 @@ def test_save_in_auto_extension_local(nb_file, tmpdir):
def test_save_in_pct_and_lgt_auto_extensions(nb_file, tmpdir):
# load notebook
nb = jupytext.read(nb_file)
if 'language_info' not in nb.metadata:
return

auto_ext = auto_ext_from_metadata(nb.metadata)
tmp_ipynb = 'notebook.ipynb'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_execute_sync(tmpdir):

@requires_nbconvert
@requires_ir_kernel
def test_execute_r(tmpdir):
def test_execute_r(tmpdir): # pragma: no cover
tmp_ipynb = str(tmpdir.join('notebook.ipynb'))
tmp_md = str(tmpdir.join('notebook.md'))

Expand Down

0 comments on commit 872c658

Please sign in to comment.