Closed list4c closed 1 year ago
🤖 🤖
Hi! 👋🏽 👋 Welcome to the Exercism Python Repo!
Thank you for opening an issue! 🐍 🌈 ✨
◦ If you'd also like to make a PR to fix the issue, please have a quick look at the Pull Requests doc.
We 💙 PRs that follow our Exercism & Track contributing guidelines!
Please feel free to submit a PR, linking to this issue.
🎉
‼️ Please Do Not ‼️ ❗ Run checks on the whole repo & submit a bunch of PRs. This creates longer review cycles & exhausts reviewers energy & time. It may also conflict with ongoing changes from other contributors. ❗ Insert only blank lines, make a closing bracket drop to the next line, change a word to a synonym without obvious reason, or add trailing space that's not an[ EOL][EOL] for the very end of text files. ❗ Introduce arbitrary changes "just to change things" . _...These sorts of things are **not** considered helpful, and will likely be closed by reviewers._ |
💛 💙 While you are here... If you decide to help out with other open issues, you have our gratitude 🙌 🙌🏽.
Anything tagged with [help wanted]
and without [Claimed]
is up for grabs.
Comment on the issue and we will reserve it for you. 🌈 ✨
@list4c - That is an excellent catch! Thank you for submitting this issue - and apologies for the extreme delay in getting back to you. I've submitted a PR to fix this. I don't like having two assertions in the same test, but I think it might be cleaner to do that instead of doing a whole separate test just to check the return type.
I considered using sort()
, but its harder to then trap the error and surface it as a test failure.
Please let me know if you have questions or issues. Thanks again for reporting this.
Hi, cool! Thanks, looks meaningful and will nicely warn users that they return an incorrect data structure.
I was doing the task no. 6 'Pull out Appetizers for Passing on Trays' and found out that my result passes tests even though it's a set and not a list.
This is because the test uses the
sorted()
function which returns an object withlist
type. I think this is a bug, because the requirements said I should return alist
.My idea of fixing the test is to use the method
sort()
instead ofsorted()
.self.assertEqual((separate_appetizers(item[0], item[1]).sort()), (result.sort()), msg=error_message)
In this case my solution does not pass and I get the following error:
AttributeError: 'set' object has no attribute 'sort'
Which may probably be a bit confusing for someone checking test output, but maybe there is a way to catch this error and throw a custom message.