Mar-09-2018, 09:56 AM
I believe that
One way to run the tests is to run each script in test folder separately. That is why they have the last two lines in each file at the end. In this case it will use numpy built-in testing support which is based on nose. However due to mistake with __mains__ vs. __main__ I believe they don't runt it even once this way. Otherwise they would have discovered the mistake.
Because numpy uses nose, I believe they were running nosetests from command line and nose just grabs all tests from the files in test folder (based on the name) and execute them one by one.
Here is more info or nose and testing with nose http://nose.readthedocs.io/en/latest/testing.html
There are also other test suites, incl. unittest module from standard python library, pytest, etc.
there are plenty of resources online on unittesting, just google the term if you wnat more info
__mains__
is an error. it should be __main__
.One way to run the tests is to run each script in test folder separately. That is why they have the last two lines in each file at the end. In this case it will use numpy built-in testing support which is based on nose. However due to mistake with __mains__ vs. __main__ I believe they don't runt it even once this way. Otherwise they would have discovered the mistake.
Because numpy uses nose, I believe they were running nosetests from command line and nose just grabs all tests from the files in test folder (based on the name) and execute them one by one.
Here is more info or nose and testing with nose http://nose.readthedocs.io/en/latest/testing.html
There are also other test suites, incl. unittest module from standard python library, pytest, etc.
there are plenty of resources online on unittesting, just google the term if you wnat more info