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
1
2
import shelve
3
+
2
4
import pytest
3
5
4
6
import schedule1 as schedule
5
7
8
+ DB_NAME = 'data/test_db'
9
+
6
10
7
- @pytest .yield_fixture
11
+ @pytest .fixture ( scope = 'module' )
8
12
def db ():
9
- with shelve .open (schedule . DB_NAME ) as the_db :
13
+ with shelve .open (DB_NAME ) as the_db :
10
14
if schedule .CONFERENCE not in the_db :
11
15
schedule .load_db (the_db )
12
16
yield the_db
17
+ os .remove (DB_NAME )
13
18
14
19
15
20
def test_record_class ():
Original file line number Diff line number Diff line change
1
+ import os
1
2
import shelve
3
+
2
4
import pytest
3
5
4
6
import schedule2 as schedule
5
7
6
8
7
- @pytest .yield_fixture
9
+ @pytest .fixture ( scope = 'module' )
8
10
def db ():
9
- with shelve .open (schedule . DB_NAME ) as the_db :
11
+ with shelve .open (DB_NAME ) as the_db :
10
12
if schedule .CONFERENCE not in the_db :
11
13
schedule .load_db (the_db )
12
14
yield the_db
15
+ os .remove (DB_NAME )
13
16
14
17
15
18
def test_record_attr_access ():
You can’t perform that action at this time.
0 commit comments