File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,9 @@ def test_open_readonly_dir_fail_rw_missing_wal_shm(self):
158158        os .chmod (self .test_dir , stat .S_IREAD  |  stat .S_IEXEC )
159159
160160        with  self .assertRaises (OSError ):
161-             db   =   dbm_sqlite3 .open (self .db_path , "w" )
162-             db [b"newkey" ] =  b"newvalue" 
163-              db . close () 
161+             with   dbm_sqlite3 .open (self .db_path , "w" )  as   db : 
162+                  db [b"newkey" ] =  b"newvalue" 
163+ 
164164
165165    def  test_open_readonly_dir_fail_rw_with_writable_db (self ):
166166        os .chmod (self .db_path , stat .S_IREAD  |  stat .S_IWRITE )
@@ -170,9 +170,8 @@ def test_open_readonly_dir_fail_rw_with_writable_db(self):
170170        os .chmod (self .test_dir , stat .S_IREAD  |  stat .S_IEXEC )
171171
172172        with  self .assertRaises (OSError ):
173-             db  =  dbm_sqlite3 .open (self .db_path , "w" )
174-             db [b"newkey" ] =  b"newvalue" 
175-             db .close ()
173+             with  dbm_sqlite3 .open (self .db_path , "w" ) as  db :
174+                 db [b"newkey" ] =  b"newvalue" 
176175
177176
178177class  ReadWrite (_SQLiteDbmTests ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments