check_output expects that reject and expect parameters are lists of strings. In case user mistakenly provides string instead of list check_output does not notice it and behaves unexpectedly. check_output should check the type of the variables and raise an exception in case variables have unexpected types.
Another user-friendly solution: check_output accepts both - strings and lists of strings and if it gets string, it transform it to single element list.
check_output expects that reject and expect parameters are lists of strings. In case user mistakenly provides string instead of list check_output does not notice it and behaves unexpectedly. check_output should check the type of the variables and raise an exception in case variables have unexpected types.
Another user-friendly solution: check_output accepts both - strings and lists of strings and if it gets string, it transform it to single element list.