mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Optimize the test for issue #13454.
Now it requires almost 4x less memory and is almost 2x faster.
This commit is contained in:
		
						commit
						dd399af438
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
					@ -1269,10 +1269,8 @@ def test_tee(self):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Issue 13454: Crash when deleting backward iterator from tee()
 | 
					    # Issue 13454: Crash when deleting backward iterator from tee()
 | 
				
			||||||
    def test_tee_del_backward(self):
 | 
					    def test_tee_del_backward(self):
 | 
				
			||||||
        forward, backward = tee(range(20000000))
 | 
					        forward, backward = tee(repeat(None, 20000000))
 | 
				
			||||||
        for i in forward:
 | 
					        any(forward)  # exhaust the iterator
 | 
				
			||||||
            pass
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        del backward
 | 
					        del backward
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_StopIteration(self):
 | 
					    def test_StopIteration(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue