python-tutorial icon indicating copy to clipboard operation
python-tutorial copied to clipboard

Fixed tests.

Open baffelli opened this issue 10 months ago • 9 comments

Closing #134.

baffelli avatar Apr 19 '24 12:04 baffelli

When executing solution_print_odd() I get ValueError: I/O operation on closed file

despadam avatar May 02 '24 15:05 despadam

When executing solution_print_salutation() I get no output at all.

despadam avatar May 02 '24 15:05 despadam

When executing solution_write_file() I get Failed: Cannot read from inexistent file.

despadam avatar May 02 '24 15:05 despadam

When executing solution_read_write_file() I get FileNotFoundError: [Errno 2] No such file or directory: '...\test_read_write_file_solution_0\\output_file.txt'

despadam avatar May 02 '24 15:05 despadam

When executing solution_print_odd() I get ValueError: I/O operation on closed file

Good catch, solved in 27fbfd8

baffelli avatar May 03 '24 06:05 baffelli

When executing solution_print_salutation() I get no output at all.

There's no test for that exercise because I could find no way to use input in iyptest

baffelli avatar May 03 '24 06:05 baffelli

solution_write_file

I changed the error message in 506ac73

baffelli avatar May 03 '24 07:05 baffelli

When executing solution_read_write_file() I get FileNotFoundError: [Errno 2] No such file or directory: '...\test_read_write_file_solution_0\\output_file.txt'

I was using pytest.fail instead of assert. This causes a confusing error message which is not properly handled by ipytest. It is now fixed in f0e83ea

baffelli avatar May 03 '24 07:05 baffelli

The table of contents should be updated, for example it does not contain exercise 3.

Will also leave some additional comments for errors I came across when trying to execute the exercises.

Done in eaac18c

baffelli avatar May 03 '24 08:05 baffelli

Hi @baffelli, all exercises run smoothly now, thanks! The only remaining topic is the TOC:

  1. Due to incorrect indentation, the list appears as text instead of links.
  2. Due to the bug we have not fixed, when you have multiple sections with the same title, the script will make all links with the same name point to the same section. Here you have multiple sections named Exercises, so whichever link you click, it will always send you to the first section with this name. A quick solution is to rename them and make each of the Exercises section have a slightly different title.

despadam avatar May 03 '24 10:05 despadam

Hi @baffelli, all exercises run smoothly now, thanks! The only remaining topic is the TOC:

1. Due to incorrect indentation, the list appears as text instead of links.

2. Due to the bug we have not fixed, when you have multiple sections with the same title, the script will make all links with the same name point to the same section. Here you have multiple sections named `Exercises`, so whichever link you click, it will always send you to the first section with this name. A quick solution is to rename them and make each of the `Exercises` section have a slightly different title.

Thank you for the hint. I cannot reproduce these problems, for me the links work correctly.

baffelli avatar May 03 '24 11:05 baffelli

Hi @baffelli, all exercises run smoothly now, thanks! The only remaining topic is the TOC:

1. Due to incorrect indentation, the list appears as text instead of links.

2. Due to the bug we have not fixed, when you have multiple sections with the same title, the script will make all links with the same name point to the same section. Here you have multiple sections named `Exercises`, so whichever link you click, it will always send you to the first section with this name. A quick solution is to rename them and make each of the `Exercises` section have a slightly different title.

Thank you for the hint. I cannot reproduce these problems, for me the links work correctly.

No worries. If it's ok then I am taking the liberty to rename the sections so the TOC will work correctly for all

despadam avatar May 03 '24 12:05 despadam