oh, there's one last problem: call the user's function one time only per input => one time only at the beginning of the test function, then use the variable you stored to do the tests
yeah, true, you can keep them (the assertion messages, I mean). But swith to assert_equals in any case. Currently, if the test fails, the user knows what you want, but not what he sents.
i think assertion message have to be anyway, because if i'm using type insted of isinstance default message will be <class '...'> should equal <class 'tuple'> for the first one and N should equal 2 for the second one, where N is the length of the output tuple. I think these messages are... not user friendly a bit, especially for the second one: user can't understand that N is the length of the output tuple
Pretty much yes. Just replace test.expect with test.assert_equals. This way you don't need the assertion message (use type instead of isinstance for the first one, so that you can ahve actual vs expected)
simply because the sympy module is not available
from sympy import isprime as num
But Codewars doesn't accept import sympy as a valid solution :(
lol wow
Please use spoiler flag also in solution comments as your comment is visible on the main page.
This comment is hidden because it contains spoiler information about the solution
Brilliant solution
That ELSE 'No' can't be a good practice
SQL code is not concrete poetry
Ah, angles are in Degrees
Can this kata even be solved?
here you are
oh, there's one last problem: call the user's function one time only per input => one time only at the beginning of the test function, then use the variable you stored to do the tests
switched it, thanks a lot
yeah, true, you can keep them (the assertion messages, I mean). But swith to assert_equals in any case. Currently, if the test fails, the user knows what you want, but not what he sents.
i think assertion message have to be anyway, because if i'm using
type
insted ofisinstance
default message will be<class '...'> should equal <class 'tuple'>
for the first one andN should equal 2
for the second one, where N is the length of the output tuple. I think these messages are... not user friendly a bit, especially for the second one: user can't understand that N is the length of the output tuplePretty much yes. Just replace
test.expect
withtest.assert_equals
. This way you don't need the assertion message (usetype
instead ofisinstance
for the first one, so that you can ahve actual vs expected)Loading more items...