Skip to content

Commit e394bdc

Browse files
committed
Adjust skip when pandoc is not available
1 parent 6cf530e commit e394bdc

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

tests/nbconvert/test_handlers.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# coding: utf-8
2-
import io
32
import json
4-
import os
5-
from os.path import join as pjoin
6-
import shutil
73

84
import tornado
95

@@ -12,7 +8,8 @@
128
new_notebook, new_markdown_cell, new_code_cell, new_output,
139
)
1410

15-
from ipython_genutils.testing.decorators import onlyif_cmds_exist
11+
from ipython_genutils.py3compat import which
12+
1613

1714
from base64 import encodebytes
1815

@@ -50,7 +47,9 @@ def notebook(jp_root_dir):
5047
nbfile.write_text(writes(nb, version=4), encoding='utf-8')
5148

5249

53-
@onlyif_cmds_exist('pandoc')
50+
pytestmark = pytest.mark.skipif(not which('pandoc'), reason="Command 'pandoc' is not available")
51+
52+
5453
async def test_from_file(jp_fetch, notebook):
5554
r = await jp_fetch(
5655
'nbconvert', 'html', 'foo', 'testnb.ipynb',
@@ -74,7 +73,6 @@ async def test_from_file(jp_fetch, notebook):
7473
assert 'print(2*6)' in r.body.decode()
7574

7675

77-
@onlyif_cmds_exist('pandoc')
7876
async def test_from_file_404(jp_fetch, notebook):
7977
with pytest.raises(tornado.httpclient.HTTPClientError) as e:
8078
await jp_fetch(
@@ -85,7 +83,6 @@ async def test_from_file_404(jp_fetch, notebook):
8583
assert expected_http_error(e, 404)
8684

8785

88-
@onlyif_cmds_exist('pandoc')
8986
async def test_from_file_download(jp_fetch, notebook):
9087
r = await jp_fetch(
9188
'nbconvert', 'python', 'foo', 'testnb.ipynb',
@@ -97,7 +94,6 @@ async def test_from_file_download(jp_fetch, notebook):
9794
assert 'testnb.py' in content_disposition
9895

9996

100-
@onlyif_cmds_exist('pandoc')
10197
async def test_from_file_zip(jp_fetch, notebook):
10298
r = await jp_fetch(
10399
'nbconvert', 'latex', 'foo', 'testnb.ipynb',
@@ -108,7 +104,6 @@ async def test_from_file_zip(jp_fetch, notebook):
108104
assert '.zip' in r.headers['Content-Disposition']
109105

110106

111-
@onlyif_cmds_exist('pandoc')
112107
async def test_from_post(jp_fetch, notebook):
113108
r = await jp_fetch(
114109
'api/contents/foo/testnb.ipynb',
@@ -136,7 +131,6 @@ async def test_from_post(jp_fetch, notebook):
136131
assert 'print(2*6)'in r.body.decode()
137132

138133

139-
@onlyif_cmds_exist('pandoc')
140134
async def test_from_post_zip(jp_fetch, notebook):
141135
r = await jp_fetch(
142136
'api/contents/foo/testnb.ipynb',

0 commit comments

Comments
 (0)