What Python testing platform to use?

I have many directories in which there are python files. These are all simple python files. For this, I did not use any framework. I want to check these py files from one central location. I should just run one command, and all * _test.py files from each directory should be called. So, is there a ready-made tool or infrastructure for my requirement?

I am looking for PyUnit to test simple py files. And we are thinking of writing one shell script that will call all these * _test.py files, using a regular expression to match the file names.

Anyone can suggest any other approach. You are always welcome.

Thanks.

+4
source share
1 answer

nose does it all. Just cd to the root of your Python file tree and run

 nosetests 

Nose finds the test files using regex (basically the word test or test is in the name):

If it looks like a test, its a test. Directory names, modules, classes, and functions are compared with regular expressions and those that match are considered tests. Any class that is a subfamily unittest.TestCase is also collected if it is inside a module that looks like a test.

+7
source

All Articles