File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11from  __future__ import  annotations 
22
33from  typing  import  Generator , Any 
4+ from  pathlib  import  Path 
45
56import  pytest 
67
1819
1920
2021@pytest .fixture () 
21- def  dbos () ->  Generator [None , Any , None ]:
22+ def  dbos (tmp_path : Path ) ->  Generator [None , Any , None ]:
23+     # Use a file-based SQLite DB so the schema persists across connections/threads 
24+     db_file : Path  =  tmp_path  /  "dbos_test.sqlite3" 
25+     # Allow usage across threads in tests 
26+     system_db_url : str  =  f"sqlite+pysqlite:///{ db_file }  ?check_same_thread=false" 
27+ 
2228    config : DBOSConfig  =  {
2329        "name" : "workflows-py-dbostest" ,
24-         "system_database_url" : "sqlite:///:memory:" ,
30+         "system_database_url" : system_db_url ,
2531        "run_admin_server" : False ,
2632    }
33+     # DBOS.reset_system_database() 
2734    DBOS (config = config )
2835    DBOS .launch ()
2936    try :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments