python-package-guide icon indicating copy to clipboard operation
python-package-guide copied to clipboard

Please tell us the meaning of the sentence

Open tkoyama010 opened this issue 1 year ago • 1 comments

The with the input of both 0 and part is missing information and cannot be read. Please tell us what you are trying to convey. https://github.com/pyOpenSci/python-package-guide/blob/53e10d6e222c0f5df1b05eddf7b4bdfdf1535865/tests/write-tests.md?plain=1#L84

tkoyama010 avatar Aug 18 '24 13:08 tkoyama010

I think it may have gotten blurred together with the example after it?

I think for the idea of testing special cases, one familiar example might be dividing by zero. Something like

Test special cases: Sometimes there are special or outlier cases. For instance, you may have some function that divides x / y: divide(x,y). Write a test for your function with y = 0 to ensure that it handles the special case correctly.

except i don't have my writing voice on right now and it could use a bit of @lwasser 's writing voice in it :)

sneakers-the-rat avatar Aug 30 '24 23:08 sneakers-the-rat

Gosh - this specific line came from a review - possibly david or someone else. But i think Jonny has it right :)

We want to encourage people to think about edge cases where something might fail. so division by 0. I don't now if there is some calculation where as a number gets really small it could fail, ect. I think the take away is

"make sure that your tests consider edge cases".

and we could add another take away that would say

if you find a bug around an edge case, add a test that covers it!

i hope that helps @tkoyama010 !! i am not sure if you are still working on this or not. i'm just going through OLD notifications and also cleaning up issues and pr's that maybe can be closed!

lwasser avatar Feb 13 '25 19:02 lwasser

@all-contributors please add @sneakers-the-rat and @lwasser for question

tkoyama010 avatar Feb 18 '25 00:02 tkoyama010

@tkoyama010

I've put up a pull request to add @sneakers-the-rat! :tada:

allcontributors[bot] avatar Feb 18 '25 00:02 allcontributors[bot]

@all-contributors please add @lwasser for question

tkoyama010 avatar Feb 18 '25 00:02 tkoyama010

@tkoyama010

I've put up a pull request to add @lwasser! :tada:

allcontributors[bot] avatar Feb 18 '25 00:02 allcontributors[bot]

Hey @tkoyama010, do you have what you need for this issue? Or, is the question still an open one? I'm trying to close older issues. This one has been sitting for a few months. Thank you!

lwasser avatar May 12 '25 22:05 lwasser