operating-system
operating-system copied to clipboard
Update conftest.py
The shell.run_check() method likely returns a list of strings (lines from the command output). However, the current implementation assumes it's a single string, using "\n".join(shell.run_check(...)). This could lead to unintended behavior if the output is already a single string or not formatted as expected.
Fix: You can simplify this by directly parsing the result without joining the lines, as json.loads can handle strings with line breaks. If the output is indeed a list, join them properly.
Summary by CodeRabbit
-
Bug Fixes
- Improved handling of JSON responses from shell commands, ensuring compatibility with both list and string outputs.
-
Refactor
- Enhanced readability and formatting of the
get_json_response
function.
- Enhanced readability and formatting of the