mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (#111577)
"./python -m test -j1 -R 3:3 --verbose3" now works as expected, since run_single_test() does not replace sys.stdout with StringIO in this case.
This commit is contained in:
		
							parent
							
								
									ef83b3fc00
								
							
						
					
					
						commit
						d9a5530d23
					
				
					 3 changed files with 34 additions and 2 deletions
				
			
		|  | @ -2120,6 +2120,29 @@ def test_crash(self): | |||
|             self.assertIn(f"Exit code {exitcode} (SIGSEGV)", output) | ||||
|         self.check_line(output, "just before crash!", full=True, regex=False) | ||||
| 
 | ||||
|     def test_verbose3(self): | ||||
|         code = textwrap.dedent(r""" | ||||
|             import unittest | ||||
|             from test import support | ||||
| 
 | ||||
|             class VerboseTests(unittest.TestCase): | ||||
|                 def test_pass(self): | ||||
|                     print("SPAM SPAM SPAM") | ||||
|         """) | ||||
|         testname = self.create_test(code=code) | ||||
| 
 | ||||
|         # Run sequentially | ||||
|         output = self.run_tests("--verbose3", testname) | ||||
|         self.check_executed_tests(output, testname, stats=1) | ||||
|         self.assertNotIn('SPAM SPAM SPAM', output) | ||||
| 
 | ||||
|         # -R option needs a debug build | ||||
|         if support.Py_DEBUG: | ||||
|             # Check for reference leaks, run in parallel | ||||
|             output = self.run_tests("-R", "3:3", "-j1", "--verbose3", testname) | ||||
|             self.check_executed_tests(output, testname, stats=1, parallel=True) | ||||
|             self.assertNotIn('SPAM SPAM SPAM', output) | ||||
| 
 | ||||
| 
 | ||||
| class TestUtils(unittest.TestCase): | ||||
|     def test_format_duration(self): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner