mirror of
				https://github.com/aykhans/AzSuicideDataVisualization.git
				synced 2025-11-04 03:49:58 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			363 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			363 B
		
	
	
	
		
			Python
		
	
	
	
	
	
"""test utilities that use async/await syntax
 | 
						|
 | 
						|
a separate file to avoid syntax errors on Python 2
 | 
						|
"""
 | 
						|
 | 
						|
import asyncio
 | 
						|
 | 
						|
 | 
						|
def async_func():
 | 
						|
    """Simple async function to schedule a task on the current eventloop"""
 | 
						|
    loop = asyncio.get_event_loop()
 | 
						|
    assert loop.is_running()
 | 
						|
 | 
						|
    async def task():
 | 
						|
        await asyncio.sleep(1)
 | 
						|
 | 
						|
    loop.create_task(task())
 |