Skip to content

Fixed tests.#223

Merged
baffelli merged 8 commits intomainfrom
134-io-module-solution-of-exercise-wrong
May 3, 2024
Merged

Fixed tests.#223
baffelli merged 8 commits intomainfrom
134-io-module-solution-of-exercise-wrong

Conversation

@baffelli
Copy link
Copy Markdown
Member

Closing #134.

@baffelli baffelli added bug upcoming tutorial Stuff to work on/fix before the next tutorial labels Apr 19, 2024
@baffelli baffelli self-assigned this Apr 19, 2024
@baffelli baffelli linked an issue Apr 19, 2024 that may be closed by this pull request
@baffelli baffelli marked this pull request as ready for review May 2, 2024 12:22
@baffelli baffelli requested a review from despadam May 2, 2024 12:22
Copy link
Copy Markdown
Contributor

@despadam despadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread input_output.ipynb Outdated
@despadam
Copy link
Copy Markdown
Contributor

despadam commented May 2, 2024

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

@despadam
Copy link
Copy Markdown
Contributor

despadam commented May 2, 2024

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

@despadam
Copy link
Copy Markdown
Contributor

despadam commented May 2, 2024

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

@despadam
Copy link
Copy Markdown
Contributor

despadam commented May 2, 2024

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'

baffelli and others added 2 commits May 3, 2024 08:13
Co-authored-by: Despina Adamopoulou <16343312+despadam@users.noreply.github.com>
@baffelli
Copy link
Copy Markdown
Member Author

baffelli commented May 3, 2024

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

Good catch, solved in 27fbfd8

@baffelli
Copy link
Copy Markdown
Member Author

baffelli commented May 3, 2024

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
Copy link
Copy Markdown
Member Author

baffelli commented May 3, 2024

solution_write_file

I changed the error message in 506ac73

@baffelli
Copy link
Copy Markdown
Member Author

baffelli commented May 3, 2024

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
Copy link
Copy Markdown
Member Author

baffelli commented May 3, 2024

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 baffelli requested a review from despadam May 3, 2024 08:00
@despadam
Copy link
Copy Markdown
Contributor

despadam commented May 3, 2024

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.

@baffelli
Copy link
Copy Markdown
Member Author

baffelli commented May 3, 2024

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.

@despadam
Copy link
Copy Markdown
Contributor

despadam commented May 3, 2024

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

Copy link
Copy Markdown
Member Author

@baffelli baffelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@baffelli baffelli merged commit dfe2bba into main May 3, 2024
@baffelli baffelli deleted the 134-io-module-solution-of-exercise-wrong branch May 3, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upcoming tutorial Stuff to work on/fix before the next tutorial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I/O module, solution of exercise wrong?

2 participants