mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	test_helpers: Remove unused timeout_mock.
We don’t want to encourage more uses of zerver.lib.timeout. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							da979bc65c
						
					
				
				
					commit
					631c2f7d4c
				
			@@ -736,18 +736,6 @@ def mock_queue_publish(
 | 
			
		||||
        yield inner
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@contextmanager
 | 
			
		||||
def timeout_mock(mock_path: str) -> Iterator[None]:
 | 
			
		||||
    # timeout() doesn't work in test environment with database operations
 | 
			
		||||
    # and they don't get committed - so we need to replace it with a mock
 | 
			
		||||
    # that just calls the function.
 | 
			
		||||
    def mock_timeout(seconds: int, func: Callable[[], object]) -> object:
 | 
			
		||||
        return func()
 | 
			
		||||
 | 
			
		||||
    with mock.patch(f"{mock_path}.timeout", new=mock_timeout):
 | 
			
		||||
        yield
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@contextmanager
 | 
			
		||||
def ratelimit_rule(
 | 
			
		||||
    range_seconds: int,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user