Add infer test cases for test indexes#181
Conversation
…est-cases-for-test-indexes
|
Thanks, great! 🎉 🎉 The file still contains a lot of commented lines that appear to be unnecessary. Can you please clean it a bit? Also, we might need to update the comments by explaining the new changes as well as removing the unnecessary ones, can you please have a detailed look at that too? Regards, |
|
Looks great! I think that if some other developer now adds a function, he might get a weird error if this file automatically generates a test case and it maybe fails (e.g. because it needs additional arguments and it's not 100% obvious to everyone where to implement that). That's why I think it would be great if you could add some explanation for other developers in the file. E.g. """
The tests below Blabla...
"""That's also what we did in |
|
@jbesomi @henrifroese Just add some comments for explanation and delete the old ones. 👌 |
henrifroese
left a comment
There was a problem hiding this comment.
Looks good to me overall 👍
tests/test_indexes.py
Outdated
|
|
||
|
|
||
| # Put functions' name into white list if you want to omit them | ||
| # func_white_list = { |
There was a problem hiding this comment.
Remove this and the next few lines? (The comment)
tests/test_indexes.py
Outdated
| test_cases_preprocessing = [ | ||
| ["fillna", preprocessing.fillna, (s_text,)], | ||
| ["lowercase", preprocessing.lowercase, (s_text,)], | ||
| ["replace_digits", preprocessing.replace_digits, (s_text, "")], |
There was a problem hiding this comment.
Can we generalize over these functions as well and avoid to define the custom test manually? Rewriting the file as you are proposing add more complexity for the developer, I can see it as worth it in case the custom functions that need to be manually defined are kept to the very minimum
There was a problem hiding this comment.
Can I assume that any functions with default params can be auto-tested?
There was a problem hiding this comment.
Then I think the simplest way might be regulating the function definition and add default params whenever possible, so the default params can be taken as a default test case.
…est-cases-for-test-indexes
|
Hey @AlfredWGA, what's the current status for this PR? |
I haven't come up with any idea on how to further avoid defining test case manually. Maybe leave it to another PR in the future? |
This PR add codes to generate test cases for each function according their input HeroSeries. Only functions with one HeroSeries input will be generated with test case. Exceptions can be manually added, for example,
Then functions within
test_case_exceptionswill not be given a generated test case.To omit some functions for testing, put them under
func_white_list,See #179.