Mercurial > pylearn
comparison _test_dataset.py @ 350:ae6605eccd09
Can give test name in debug mode. This will execute on the gived test name.
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Tue, 17 Jun 2008 16:20:17 -0400 |
parents | 2174fe5cc7d0 |
children | cefa8518ff48 |
comparison
equal
deleted
inserted
replaced
349:2174fe5cc7d0 | 350:ae6605eccd09 |
---|---|
661 for k in range(len(dsc)) : | 661 for k in range(len(dsc)) : |
662 self.failUnless(numpy.all( dsc[k]('input')[0] == ds[k]('input')[0] ) , (dsc[k],ds[k]) ) | 662 self.failUnless(numpy.all( dsc[k]('input')[0] == ds[k]('input')[0] ) , (dsc[k],ds[k]) ) |
663 res = dsc[:] | 663 res = dsc[:] |
664 | 664 |
665 if __name__=='__main__': | 665 if __name__=='__main__': |
666 if len(sys.argv)==2: | 666 tests = [] #'test_RenamedFieldsDataSet'] |
667 if sys.argv[1]=="--debug": | 667 # unittest.TestSuite(map(T_DataSet, tests)).debug() |
668 # sys.exit() | |
669 debug=False | |
670 if len(sys.argv)==1: | |
671 unittest.main() | |
672 else: | |
673 assert sys.argv[1]=="--debug" | |
674 for arg in sys.argv[2:]: | |
675 tests.append(arg) | |
676 if tests: | |
677 unittest.TestSuite(map(T_DataSet, tests)).debug() | |
678 else: | |
668 module = __import__("_test_dataset") | 679 module = __import__("_test_dataset") |
669 tests = unittest.TestLoader().loadTestsFromModule(module) | 680 tests = unittest.TestLoader().loadTestsFromModule(module) |
670 tests.debug() | 681 tests.debug() |
671 print "bad argument: only --debug is accepted" | |
672 elif len(sys.argv)==1: | |
673 unittest.main() | |
674 else: | |
675 print "bad argument: only --debug is accepted" | |
676 |