Hello!
When testing my HW4 program, I am getting a strange error in the testcase test_zz_top_types which is: TypeError: type of the return value must be str; got list instead.
The main function of my program is structured in this way: return B(A(filename)), where A() returns a list of strings found in the files and B() generates the final string from the list based on the rules of the homework. Strangely enough, the testcase mentioned above seems to get as a result the return value of A() and doesn't pass it through B(). It is not that the testcase calls A() directly, it calls the main function which I described above and it should have received the final string instead of the list of strings.
When tested manually, the program gives the proper output for the input 'test01/A.txt' but this doesn't happen in the test, despite the same input.
If any of the professors could look into the case, I would appreciate it a lot.
UPDATE: I merged A() into the main function and it works now. Apparently, the function picks the first thing that is returned in the whole program, instead of what the main function returns eventually. I believe that this should be changed in future homework as it goes against the expected logical flow of a program and discourages better organization of code.
When testing my HW4 program, I am getting a strange error in the testcase test_zz_top_types which is: TypeError: type of the return value must be str; got list instead.
The main function of my program is structured in this way: return B(A(filename)), where A() returns a list of strings found in the files and B() generates the final string from the list based on the rules of the homework. Strangely enough, the testcase mentioned above seems to get as a result the return value of A() and doesn't pass it through B(). It is not that the testcase calls A() directly, it calls the main function which I described above and it should have received the final string instead of the list of strings.
When tested manually, the program gives the proper output for the input 'test01/A.txt' but this doesn't happen in the test, despite the same input.
If any of the professors could look into the case, I would appreciate it a lot.
UPDATE: I merged A() into the main function and it works now. Apparently, the function picks the first thing that is returned in the whole program, instead of what the main function returns eventually. I believe that this should be changed in future homework as it goes against the expected logical flow of a program and discourages better organization of code.