mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)
Alo use load_tests() for adding tests.
This commit is contained in:
		
							parent
							
								
									5e2c32e08e
								
							
						
					
					
						commit
						a856364cc9
					
				
					 17 changed files with 117 additions and 183 deletions
				
			
		| 
						 | 
				
			
			@ -1266,6 +1266,7 @@
 | 
			
		|||
"""
 | 
			
		||||
 | 
			
		||||
import re
 | 
			
		||||
import doctest
 | 
			
		||||
import unittest
 | 
			
		||||
 | 
			
		||||
from test import support
 | 
			
		||||
| 
						 | 
				
			
			@ -1554,10 +1555,10 @@ def test_syntax_error_on_deeply_nested_blocks(self):
 | 
			
		|||
        self._check_error(source, "too many statically nested blocks")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_main():
 | 
			
		||||
    support.run_unittest(SyntaxTestCase)
 | 
			
		||||
    from test import test_syntax
 | 
			
		||||
    support.run_doctest(test_syntax, verbosity=True)
 | 
			
		||||
def load_tests(loader, tests, pattern):
 | 
			
		||||
    tests.addTest(doctest.DocTestSuite())
 | 
			
		||||
    return tests
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    test_main()
 | 
			
		||||
    unittest.main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue