[lxml-dev] unittest.main()

Martijn Faassen faassen at startifact.com
Wed May 30 22:43:08 CEST 2007


Ian Bicking wrote:
> I noticed many tests have:
> 
>    if __name__ == '__main__':
>        unittest.main()
> 
> But this seems to ignore test_suite(), so it's not really very useful. 
> This seems more helpful:
> 
>    if __name__ == '__main__':
>        print 'to test use test.py %s' % __file__
> 

I always run the tests through the test.py testrunner. I tend to remove 
the __name__ == '__main__' bits and rely on the test runner to collect 
tests completely. I imagine someone put this in for a reason, though. 
Perhaps it was even me, long ago?

Regards,

Martijn



More information about the lxml-dev mailing list