File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1+ import os
12import shelve
3+
24import pytest
35
46import schedule1 as schedule
57
8+ DB_NAME = 'data/test_db'
9+
610
7- @pytest .yield_fixture
11+ @pytest .fixture ( scope = 'module' )
812def db ():
9- with shelve .open (schedule . DB_NAME ) as the_db :
13+ with shelve .open (DB_NAME ) as the_db :
1014 if schedule .CONFERENCE not in the_db :
1115 schedule .load_db (the_db )
1216 yield the_db
17+ os .remove (DB_NAME )
1318
1419
1520def test_record_class ():
Original file line number Diff line number Diff line change 1+ import os
12import shelve
3+
24import pytest
35
46import schedule2 as schedule
57
68
7- @pytest .yield_fixture
9+ @pytest .fixture ( scope = 'module' )
810def db ():
9- with shelve .open (schedule . DB_NAME ) as the_db :
11+ with shelve .open (DB_NAME ) as the_db :
1012 if schedule .CONFERENCE not in the_db :
1113 schedule .load_db (the_db )
1214 yield the_db
15+ os .remove (DB_NAME )
1316
1417
1518def test_record_attr_access ():
You can’t perform that action at this time.
0 commit comments