pierrepo / PBxplore

A suite of tools to explore protein structures with Protein Blocks :snake:
https://pbxplore.readthedocs.org/en/latest/
MIT License
28 stars 17 forks source link

[WIP] Add unit tests #122

Closed HubLot closed 8 years ago

HubLot commented 8 years ago

Hi,

I'm currently adding unit tests into the package to increase its 'robustness', specially on the different functions of the package (I think the scripts in test_regression.py are very well covered). I also realized that I introduced some functions before without unit tests associated (booo).

HubLot commented 8 years ago

Hi,

Here a few commits to close this PR:

import pbxplore
pbxplore.tests()

One small issue: usually the test folder is named "tests" and the function is named "test". Here, it's the other way. I could rename those if you want before merging. Another one is that nose automatically find tests by researching keywords. To prevent it to run this new function tests(), we need to specify the test folder now:

nosetests -v pbxplore/test

I updated those information into the install page of the documentation by creating a chapter called "Testing PBxplore".

pierrepo commented 8 years ago

Great work @HubLot !

One small issue: usually the test folder is named "tests" and the function is named "test". Here, it's the other way. I could rename those if you want before merging.

If you feel this is more mainstream to have the test function named test() and the test directory tests, you can rename them.

Regarding system_info and the module_info() function, be aware that not all Python modules have their version number in __version__.

@jbarnoud what do you think?

HubLot commented 8 years ago

Regarding system_info and the module_info() function, be aware that not all Python modules have their version number in version.

Indeed, I'll add a test to prevent the possible error.

HubLot commented 8 years ago

I updated the PR.

@jbarnoud can you review?

jbarnoud commented 8 years ago

I'll look at it on Saturday.

On 12-05-16 16:51, Hub wrote:

I updated the PR.

@jbarnoud https://github.com/jbarnoud can you review?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/pierrepo/PBxplore/pull/122#issuecomment-218781792

jbarnoud commented 8 years ago

I posted a few comments. Besides these, everything looks good to me.

HubLot commented 8 years ago

I updated the PR with @jbarnoud comments. I also renamed the test folder "tests" and the function 'tests()' into 'test()' to be more 'mainstream' (and of course, updated the documentation and travis). If you don't agree, I can roll back to the previous version. If you agree, the PR can be merged :)