Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "Implemented cwd parameter"
  • Loading branch information
depau authored Feb 16, 2021
commit c764166f442a4b726c05a4d340f3e53cb11a497a
6 changes: 1 addition & 5 deletions ffmpeg/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ def run_async(
pipe_stderr=False,
quiet=False,
overwrite_output=False,
cwd=None
):
"""Asynchronously invoke ffmpeg for the supplied node graph.

Expand Down Expand Up @@ -286,8 +285,7 @@ def run_async(
stderr_stream = subprocess.STDOUT
stdout_stream = subprocess.DEVNULL
return subprocess.Popen(
args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream,
cwd=cwd
args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
)


Expand All @@ -300,7 +298,6 @@ def run(
input=None,
quiet=False,
overwrite_output=False,
cwd=None
):
"""Invoke ffmpeg for the supplied node graph.

Expand All @@ -324,7 +321,6 @@ def run(
pipe_stderr=capture_stderr,
quiet=quiet,
overwrite_output=overwrite_output,
cwd=cwd
)
out, err = process.communicate(input)
retcode = process.poll()
Expand Down
9 changes: 3 additions & 6 deletions ffmpeg/tests/test_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,12 @@ def test__compile():
@pytest.mark.parametrize('pipe_stdin', [True, False])
@pytest.mark.parametrize('pipe_stdout', [True, False])
@pytest.mark.parametrize('pipe_stderr', [True, False])
@pytest.mark.parametrize('cwd', [None, '/tmp'])
def test__run_async(mocker, pipe_stdin, pipe_stdout, pipe_stderr, cwd):
def test__run_async(mocker, pipe_stdin, pipe_stdout, pipe_stderr):
process__mock = mock.Mock()
popen__mock = mocker.patch.object(subprocess, 'Popen', return_value=process__mock)
stream = _get_simple_example()
process = ffmpeg.run_async(
stream, pipe_stdin=pipe_stdin, pipe_stdout=pipe_stdout,
pipe_stderr=pipe_stderr, cwd=cwd
stream, pipe_stdin=pipe_stdin, pipe_stdout=pipe_stdout, pipe_stderr=pipe_stderr
)
assert process is process__mock

Expand All @@ -458,8 +456,7 @@ def test__run_async(mocker, pipe_stdin, pipe_stdout, pipe_stderr, cwd):
(args,), kwargs = popen__mock.call_args
assert args == ffmpeg.compile(stream)
assert kwargs == dict(
stdin=expected_stdin, stdout=expected_stdout, stderr=expected_stderr,
cwd=cwd
stdin=expected_stdin, stdout=expected_stdout, stderr=expected_stderr
)


Expand Down