In #465 we replaced a large portion of the CLI unit tests to use monkeypatch. This speeds up the unit tests by an extreme amount, but we had to alter how we captured output for these tests as we were no longer piping the output of a subprocess call. We used redirect_stdout/stderr to an IO Stream to capture the output of the commands, but this can likely be replaced by using pytest.capsys. This is a low priority issue as what we have currently works fine, but will definitely clean up some of the unit tests if we get this implemented.
Requested Update
Description
In #465 we replaced a large portion of the CLI unit tests to use
monkeypatch
. This speeds up the unit tests by an extreme amount, but we had to alter how we captured output for these tests as we were no longer piping the output of a subprocess call. We usedredirect_stdout/stderr
to an IO Stream to capture the output of the commands, but this can likely be replaced by usingpytest.capsys
. This is a low priority issue as what we have currently works fine, but will definitely clean up some of the unit tests if we get this implemented.Background and Motivation
This stems from two comments (1, 2) on #465.
Code to demonstrate issue
tests/unit_tests/commandline/cli_top_level_tester:capture_output & viable_monkeypatch
.Checklist for Completion
pytest.capsys
calls