Changeset 5616


Ignore:
Timestamp:
14/08/09 10:25:51 (10 years ago)
Author:
spascoe
Message:

Make a test better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/tests/test_db2.py

    r5615 r5616  
    77import sqlalchemy as SA 
    88 
    9 if os.path.exists('/tmp/test.db'): 
    10     os.remove('/tmp/test.db') 
     9import tempfile 
    1110 
    12 engine = SA.create_engine('sqlite:////tmp/test.db') 
    13 #engine = SA.create_engine('sqlite:////disks/westerly1/pnorton/db/trunk_server.db') 
    1411 
    15 #engine = SA.create_engine('sqlite:///:memory:') 
     12(fd, tmpdb) = tempfile.mkstemp(suffix='.db', prefix='tmp_cows_wps') 
     13os.close(fd) 
     14 
     15engine = SA.create_engine('sqlite:///%s' % tmpdb) 
    1616engine.echo = True 
    1717tables.metadata.create_all(engine) 
     
    6464print req.job.__class__ 
    6565session.close() 
     66 
     67 
     68os.remove(tmpdb) 
Note: See TracChangeset for help on using the changeset viewer.