-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add unit tests #27
Add unit tests #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Looks good, just have a few minor comments. I might come back later with more when I run this locally.
About Python 2: since in the meantime Python 2.7 has reached end of life, I think we should just remove support for it. At this point, it's just a source of pain. I'll remove everything related to it today or the coming days. About the next steps: ya, I agree that both of those should be next. I'll probably add some github actions to check the code style too. Wanted to play around with that feature for some time now and this is a good excuse 😄 I think this is a good initial set of tests for a PR, we can add more later and keep the PRs small and low complexity. |
Just made a PR to remove Python 2 support (#28). @NaleRaphael can you give it a look just in case I missed something? We would then first merge #28 and then rebase this PR and remove the fix to the compatibility issue |
The fix for Py2k compatibility issue is removed. I'll submit a revision for requested changes later 😎 |
Other requested changes mentioned in PR davidtvs#27 are also done in this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
BTW, would it be better to format these code with a linter you are using? I could apply the configuration you given and submit a new commit for fixing the coding style, and it might reduce your workload on checking it. 😊 |
Just pushed my flake8 configuration. For formatting, I use black with default settings. |
This is a draft of unit tests for this package. For details of how test cases are written, please check out "tests/README.md".
Other requested changes mentioned in PR davidtvs#27 are also done in this commit.
Local imports in `collect_task_classes()` is not necessary since module `task` has been imported in global.
I've updated this branch and formatted the code with black. And the following part is kept as it was in case there are more tasks to be run in the future: # in test_lr_finder.py
@pytest.mark.parametrize(
"cls_task",
[
mod_task.XORTask,
mod_task.DiscriminativeLearningRateTask,
],
)
def test_reset(self, cls_task): |
Looks good, thanks for the PR. |
Thanks! More tests would be done lately in a few weeks to make the coverage rate higher, and I would open a new PR when it is ready. |
Thanks to @NaleRaphael that proposed the change in #27 and so I just had to copy and paste 😃
Hi @davidtvs, this is a draft of unit tests for this package. Let's continue the discussion and get it completed! And please feel free to give me any suggestion.
Currently, I build some classes inheriting
BaseTask
to make us able to write test cases more conveniently. And I choosepytest
as the unit test framework, since there are bunch of functional extensions which may help us maintain these test easily. You can check out more details intests/README.md
.There are still some tests need to be done, I will finish them in these days.
Besides, here are some items that I would recommend to do later:
travis-ci
is a good choice for GitHub project)pytest-cov
and host the report oncodecov.io
)Finally, a compatibility issue is found during the development of these tests. But I'm not sure whether it is good to send it as a new PR. In order to make it be managed easily, it's attached in this PR currently.