Skip to content

Commit b2738b4

Browse files
Fixes test cases that uses python, while only python3 is available: Fixes #276 (#302)
* Updated tests cases that write python scripts, to use the python interpreter that the tests was run with * fixed test cases
1 parent 3e7676d commit b2738b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def test_conversion_with_empty_filter(self):
311311
def test_conversion_with_python_filter(self):
312312
markdown_source = "**Here comes the content.**"
313313
python_source = '''\
314-
#!/usr/bin/env python
314+
#!{0}
315315
316316
"""
317317
Pandoc filter to convert all regular text to uppercase.
@@ -328,6 +328,8 @@ def caps(key, value, format, meta):
328328
toJSONFilter(caps)
329329
'''
330330
python_source = textwrap.dedent(python_source)
331+
python_source.format(sys.executable)
332+
331333
with closed_tempfile(".py", python_source) as tempfile:
332334
output = pypandoc.convert_text(
333335
markdown_source, to='html', format='md', outputfile=None, filters=tempfile
@@ -362,7 +364,7 @@ def test_conversion_with_mixed_filters(self):
362364
lua = textwrap.dedent(lua)
363365

364366
python = """\
365-
#!/usr/bin/env python
367+
#!{0}
366368
367369
from pandocfilters import toJSONFilter, Para, Str
368370
@@ -375,6 +377,7 @@ def func(key, value, format, meta):
375377
376378
"""
377379
python = textwrap.dedent(python)
380+
python.format(sys.executable)
378381

379382
with closed_tempfile(".lua", lua.format(1)) as temp1, closed_tempfile(".py", python.format(2)) as temp2:
380383
with closed_tempfile(".lua", lua.format(3)) as temp3, closed_tempfile(".py", python.format(4)) as temp4:

0 commit comments

Comments
 (0)