Merge remote-tracking branch 'origin/pr/3356'

This commit is contained in:
Florian Bruhin 2017-12-03 22:30:30 +01:00
commit bbc2f14e45

View File

@ -49,7 +49,7 @@ def set_up_editor_replacement(quteproc, server, tmpdir, text, replacement):
@bdd.when(bdd.parsers.parse('I set up a fake editor returning "{text}"'))
def set_up_editor(quteproc, server, tmpdir, text):
def set_up_editor(quteproc, tmpdir, text):
"""Set up editor.command to a small python script inserting a text."""
script = tmpdir / 'script.py'
script.write(textwrap.dedent("""
@ -63,13 +63,13 @@ def set_up_editor(quteproc, server, tmpdir, text):
@bdd.when(bdd.parsers.parse('I set up a fake editor returning empty text'))
def set_up_editor_empty(quteproc, server, tmpdir):
def set_up_editor_empty(quteproc, tmpdir):
"""Set up editor.command to a small python script inserting empty text."""
set_up_editor(quteproc, server, tmpdir, "")
set_up_editor(quteproc, tmpdir, "")
@bdd.when(bdd.parsers.parse('I set up a fake editor that waits'))
def set_up_editor_wait(quteproc, server, tmpdir):
def set_up_editor_wait(quteproc, tmpdir):
"""Set up editor.command to a small python script inserting a text."""
pidfile = tmpdir / 'editor_pid'
script = tmpdir / 'script.py'
@ -90,7 +90,7 @@ def set_up_editor_wait(quteproc, server, tmpdir):
@bdd.when(bdd.parsers.parse('I kill the waiting editor'))
def kill_editor_wait(quteproc, server, tmpdir):
def kill_editor_wait(tmpdir):
"""Kill the waiting editor."""
pidfile = tmpdir / 'editor_pid'
pid = int(pidfile.read())