def initialized_tasks_db(tmpdir: str): """テスト前にDB接続""" tasks.start_tasks_db(str(tmpdir), 'tiny') yield tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after.""" tasks.start_tasks_db(str(tmpdir), 'tiny') yield # return -> sends specified value when called # whereas yield -> produce sequence of values tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): '''Connect to db before testing, disconnect after.''' # Setup: start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # testing happens here # Teardown: stop db tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after""" tasks.start_tasks_db(str(tmpdir), "tiny") yield tasks.stop_tasks_db()
def test_db_has_no_signs_by_default(): """Check, that after initialization db has 0 signes""" tasks.start_tasks_db(str("."), 'tiny') tasks.delete_all() cur_count = tasks.count() assert cur_count == 0 tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after.""" # Setup : start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # this is where the testing happens # Teardown : stop db tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to the db before testing, disconnect after.""" tasks.start_tasks_db(str(tmpdir), 'tiny') yield # This is where the testing happens tasks.stop_tasks_db()
def tasks_db_session(tmpdir_factory): """Connect to db before tests, disconncet after.""" temp_dir = tmpdir_factory.mktemp('temp') tasks.start_tasks_db(str(temp_dir), 'tiny') yield tasks.stop_tasks_db()
def tasks_db_session(tmpdir_factory): temp_dir = tmpdir_factory.mktemp('temp') tasks.start_tasks_db(str(temp_dir), 'tiny') yield tasks.stop_tasks_db()
def task_db_session(tmpdir_factory): # フィクスチャのセッションスコープで # 一時ディレクトリとデータベース接続設定を実行 temp_dir = tmpdir_factory.mktemp('temp') tasks.start_tasks_db(str(temp_dir), 'tiny') yield tasks.stop_tasks_db()
def tasks_db_session(tmpdir_factory, request): temp_dir = tmpdir_factory.mktemp('temp') tasks.start_tasks_db(str(temp_dir), request.param) yield tasks.stop_tasks_db()
def tasks_db(tmpdir): """Connect to db before tests, disconnect after.""" tasks.start_tasks_db(str(tmpdir), 'tiny') yield # this is where the testing happens # Teardown : stop db tasks.stop_tasks_db()
def test_after_deletion_db_count_changes(): """ Check, that after deletion count changes """ tasks.start_tasks_db(str("."), 'tiny') before_deletion_count = tasks.count() tasks.delete(pytest.task_id) after_deletion_count = tasks.count() assert before_deletion_count - 1 == after_deletion_count tasks.stop_tasks_db()
def test_after_update_db_count_not_change(): """ Check, that after update count doesn't change """ tasks.start_tasks_db(str("."), 'tiny') before_update_count = tasks.count() tasks.update(pytest.task_id, Task(done=True)) after_update_count = tasks.count() assert before_update_count == after_update_count tasks.stop_tasks_db()
def tasks_db(tmpdir): """Connect to db before tests, disconnect after.""" tasks.start_tasks_db(str(tmpdir), 'tiny') yield tasks.stop_tasks_db()
def tasks_db_session(tmpdir_factory, request): """Connect to db before testing, disconnect after.""" # Setup: start db temp_dir = tmpdir_factory.mktemp('temp') tasks.start_tasks_db(str(temp_dir), request.param) yield # this is where testing happens # Teardown: stop db tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): tasks.start_tasks_db(str(tmpdir), 'tiny') yield tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after.""" # Setup tasks.start_tasks_db(str(tmpdir), 'tiny') yield # Excetute tests. # TearDown tasks.stop_tasks_db()
def tasks_db_session(tmpdir_factory, request): """Connect to db before tests, disconnect after.""" temp_dir = tmpdir_factory.mktemp('temp') tasks.start_tasks_db(str(temp_dir), request.param) yield tasks.stop_tasks_db()
def tasks_db(tmpdir): """ connect db before tests, disconnect after""" tasks.start_tasks_db(str(tmpdir), "tiny") # テストの実行 yield # DB接続の終了 tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after.""" # setup: start db connection tasks.start_tasks_db(str(tmpdir), 'tiny') yield # execute test # teardown: terminate db connection tasks.stop_tasks_db()
def tasks_db(tmpdir): # tmpdir is a function scope: go to pag 59 to understand the scope meaning """Connect to db before tests, disconnect after.""" # Setup : start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # this is where the testing happens # Teardown : stop db tasks.stop_tasks_db()
def tasks_db(tmpdir): """Connect to db bfore tests, disconnect after""" # setup : start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # this is where the testing haens # teardown tasks.stop_tasks_db()
def tasks_db(tmpdir): """Connect to db before tests, disconnect after.""" # Setup: start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # Teardown: stop db tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after.""" # Setup : start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # здесь происходит тестирование # Teardown : stop db tasks.stop_tasks_db()
def test_after_task_creation_db_count_changes(): """ Check, that after task creation count chages """ tasks.start_tasks_db(str("."), 'tiny') before_creation_count = tasks.count() task = Task('breathe', 'Brian', True) pytest.task_id = tasks.add(task) actual_count = tasks.count() assert before_creation_count + 1 == actual_count tasks.stop_tasks_db()
def initialized_task_db(tmpdir): # Task DBを初期化 tasks.start_tasks_db(str(tmpdir), 'tiny') # ここでテストを実行 yield # DB接続終了 tasks.stop_tasks_db()
def initilized_tasks_db(tmpdir): """connnect to db befre testing, disonnect after""" # setup :start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # this is where the teting happens # teardown : stop db tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """Connect to db before testing, disconnect after""" # SETUP: start db tasks.start_tasks_db(str(tmpdir), 'tiny') yield # Where the test occurs # Teardown: stop db tasks.stop_tasks_db()
def initialized_tasks_db(tmpdir): """connect db""" # SETUP tasks.start_tasks_db(str(tmpdir), 'tiny') # this is where testing happen yield # TEARDOWN tasks.stop_tasks_db()