New design or logic for test_subprocess.py
#181
Labels
priority:low
Low priority Issues that do not need to be addressed in the near future.
testing
Add unit/integration tests
A lot of the tests under
TestRunCmd
intest_subprocess.py
are greedy: they test more than they say they are testing.test_stdout_is_suppressed_in_non_verbose_mode
is supposed to test stdout but it carriesassert
clauses for stdout and stderr.test_stderr_is_suppressed_in_non_verbose_mode
is also testing on stdout and stderr.test_command_and_stdout_is_printed_in_verbose_mode
andtest_command_and_stderr_is_redirected_to_stdout_in_verbose_mode
are identical tests with different inputs and outputs. Should we parametrize?test_output_is_captured_with_capture_output_enabled
andtest_stderr_captured_to_stdout
are the same with different input and outputs. But should the first test only test on stdout and not stderr?test_command_is_printed_and_stdout_is_captured_in_verbose_mode
: why test on stderr?test_stdout_is_redirected_to_file
: why test anything else but the file content?test_command_is_printed_and_stdout_is_redirected_to_file_in_verbose_mode
: why test on stderr?We could also redesign the tests to be for a series of cases using parameterisation (I'm not sure all are necessary). Tests would be:
And run all of these on this series of inputs:
echo foo 1>&2
)I'm not sure if all these inputs are necessary or if we need more (do we need to test for capture_output + file printing?).
Also, rename
captured
in the tests as that is confusing with thecapture_output
option.The text was updated successfully, but these errors were encountered: