Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commitf31f0cb

Browse files
authored
Merge pull request#14 from erika-dike/setup_tests_to_use_separate_shelve_test_db
Tests should use a separate shelve test database
2 parents03d3494 +17dac42 commitf31f0cb

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

‎19-dyn-attr-prop/oscon/test_schedule1.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
importos
12
importshelve
3+
24
importpytest
35

46
importschedule1asschedule
57

8+
DB_NAME='data/test_db'
9+
610

7-
@pytest.yield_fixture
11+
@pytest.fixture(scope='module')
812
defdb():
9-
withshelve.open(schedule.DB_NAME)asthe_db:
13+
withshelve.open(DB_NAME)asthe_db:
1014
ifschedule.CONFERENCEnotinthe_db:
1115
schedule.load_db(the_db)
1216
yieldthe_db
17+
os.remove(DB_NAME)
1318

1419

1520
deftest_record_class():

‎19-dyn-attr-prop/oscon/test_schedule2.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
importos
12
importshelve
3+
24
importpytest
35

46
importschedule2asschedule
57

68

7-
@pytest.yield_fixture
9+
@pytest.fixture(scope='module')
810
defdb():
9-
withshelve.open(schedule.DB_NAME)asthe_db:
11+
withshelve.open(DB_NAME)asthe_db:
1012
ifschedule.CONFERENCEnotinthe_db:
1113
schedule.load_db(the_db)
1214
yieldthe_db
15+
os.remove(DB_NAME)
1316

1417

1518
deftest_record_attr_access():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp