-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor exercises to match canonical data #1762
Comments
@cmccandless Do we keep this checklist up to date? |
@spencer51324312 I attempt to, yes. |
@cmccandless - I would love to help with this, but want to make sure I do so in the "right" way. Should I just dig into whichever non-checked off exercise is next on the list and have at it - one pull per exercise changed? |
Perfect! |
So I am going to call out binary-search. I really don't think that the |
..on second thought, I will go ahead and do the changes, and if the answer is no, we can just kill the pull request. |
I did a check for the exercise "two-fer", everything seems to be in order with that one, reflects the canonical data as is in my opinion. |
@Grociu regarding |
canonical-data.json for the What I did so far is |
@Grociu You might consider storing the builtin definition of old_sum = sum
def new_sum(nums, maximum):
return old_sum(...)
sum = new_sum |
For
def assertFactorsEqual(self, actual, expected):
self.assertEqual(set(map(frozenset, actual)),
set(map(frozenset, expected))) which effectively negates any data type returned by the code under test (provided that the data type is an iterable that can be made into a
|
For |
Nope; the decision was made to not require students to use exact error message, only to have a message present. It's up to mentors then to comment on whether the exception messages match the case. |
OK, thanks. Can you point me towards the reason this is not marked as done? I see an inconsistency in declaring strings |
I picked up on most of those via a script; it looks like that one might've been a false positive. I've checked it off. |
All items on the above list have been addressed, so I'm closing this issue. |
There are a number of exercises that fall into one of the following cases:
Function names that differ from those specified in the canonical data
armstrong-numbers
usesis_armstrong
instead ofis_armstrong_number
:python/exercises/armstrong-numbers/example.py
Lines 1 to 2 in 222c029
From the canonical-data:
*Note: in these cases, the camelCase names used in the canonical data should be converted to snake_case names in the tests, example solution, and solution stub.
Test input format differs from canonical data
tournament
passes a multiline string instead of a list of single-line strings.python/exercises/tournament/tournament_test.py
Lines 51 to 57 in 222c029
From the canonical-data:
Test output format differs from canonical data
saddle-points
expects a set of tuples instead of a list of dict objectspython/exercises/saddle-points/saddle_points_test.py
Lines 16 to 18 in 222c029
From the canonical-data:
Test input order differs from canonical data
change
uses the ordertarget, coins
instead ofcoins, target
python/exercises/change/change_test.py
Lines 9 to 10 in 222c029
From the canonical-data:
In an effort to simplify the job of the WIP test generator, it would be beneficial to reduce these inconsistencies now, so that it does not become the job of the generator PR to correct example solutions and stubs that do not match newly generated tests.
Here is the full list of exercises in which this occurs
sum-of-multiples(foregoing updates for now)This issue may be considered resolved once all of the above issues have been updated to match the canonical properties.
The text was updated successfully, but these errors were encountered: