As the Kata author, to reply to several comments. I suggested 6 kyu for this Kata based on the concept, but when it was approved the rating was set at 7 kyu by the approver. I cannot edit the rank. Follow-up with the approver or a moderator if you wish
Traceback (most recent call last):
File "main.py", line 13, in <module>
test.assert_equals(select_key(inp), working_sol(inp), message='Input: {}'.format(inp))
File "main.py", line 10, in working_sol
return next(iter(d))
StopIteration
Happens in the full test suite while I pass the sample tests. That's because I'm currently mutating the input. Two courses of actions, here:
you allow that bad habit by giving copies of the dict to the user
for one time (in context of CW), you don't go that way, but then, you should put a specific test before the random tests that fails if the dict is mutated, with an appropriate error message.
cheers
PS: need at least 80% about the satisfaction rate, for an approval. Edit: mmmh... Seeing the current rate, that might never happen... Would need a lot of very satisfied votes, now... :/ (something like 10 in a row, I'd say)
Python: Random tests are vulnerable to input modification
python new test framework is required. updated in this fork
Test framework and solution should be imported explicitly in sample tests.
As the Kata author, to reply to several comments. I suggested 6 kyu for this Kata based on the concept, but when it was approved the rating was set at 7 kyu by the approver. I cannot edit the rank. Follow-up with the approver or a moderator if you wish
New test framework should be used.
New test framework should be used.
New test framework should be used.
apparently no ;o
Happens in the full test suite while I pass the sample tests. That's because I'm currently mutating the input. Two courses of actions, here:
cheers
PS: need at least 80% about the satisfaction rate, for an approval. Edit: mmmh... Seeing the current rate, that might never happen... Would need a lot of very satisfied votes, now... :/ (something like 10 in a row, I'd say)