mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	When run as a script, runs each test and sends results to stdout
(i.e. this restores the old functionality). Note that if a test couldn't be imported, it is just ignored (and no warning is printed).
This commit is contained in:
		
							parent
							
								
									272c00b634
								
							
						
					
					
						commit
						2e644a0f86
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
					@ -17,3 +17,20 @@ tests = ['test_grammar',
 | 
				
			||||||
	 'test_dbm',
 | 
						 'test_dbm',
 | 
				
			||||||
	 'test_new',
 | 
						 'test_new',
 | 
				
			||||||
	 ]
 | 
						 ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == '__main__':
 | 
				
			||||||
 | 
					    # low-overhead testing, for cases where autotest.py harness
 | 
				
			||||||
 | 
					    # doesn't even work!
 | 
				
			||||||
 | 
					    import sys
 | 
				
			||||||
 | 
					    from test_support import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for t in tests:
 | 
				
			||||||
 | 
					        print t
 | 
				
			||||||
 | 
						unload(t)
 | 
				
			||||||
 | 
						try:
 | 
				
			||||||
 | 
						    __import__(t, globals(), locals())
 | 
				
			||||||
 | 
						except ImportError, msg:
 | 
				
			||||||
 | 
					## 	    sys.stderr.write('%s.  Uninstalled optional module?\n' % msg)
 | 
				
			||||||
 | 
						    pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    print 'Passed all tests.'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue