Closed iv-m closed 2 years ago
test_yq_arg_handling has the following line:
test_yq_arg_handling
self.run_yq("{}", [], expect_exit_codes={0} if sys.stdin.isatty() else {2})
As far as I understood, that exit code selection should match this part of cli(...):
cli(...)
if sys.stdin.isatty() and not args.input_streams: parser.print_help() sys.exit(2)
But it does not, because:
stdin
StringIO
run_yq
So the test fails whenever it's run with non-TTY stdin, e.g. '< /dev/null' or in some automated build environment.
test_yq_arg_handling
has the following line:As far as I understood, that exit code selection should match this part of
cli(...)
:But it does not, because:
stdin
is a TTY, not vice versa)stdin
is not a TTY in this test anyway, as sys.stdin is replaced withStringIO
inrun_yq
methodSo the test fails whenever it's run with non-TTY
stdin
, e.g. '< /dev/null' or in some automated build environment.