diff --git a/app/test/conftest.py b/app/test/conftest.py index 9f448b4..37c0209 100644 --- a/app/test/conftest.py +++ b/app/test/conftest.py @@ -1,6 +1,8 @@ import pytest import sqlite3 +import time from selenium import webdriver +from pathlib import Path @pytest.fixture @@ -23,7 +25,7 @@ def PASSWORD(): return 'l0ve1t' -@pytest.fixture(autouse=True) +@pytest.fixture def restore_sqlite_database(): ''' Automatically restore SQLite database file app/db/wordfreqapp.db @@ -35,3 +37,9 @@ def restore_sqlite_database(): con.executescript('DROP TABLE IF EXISTS article;') con.executescript(open('../static/wordfreqapp.sql', encoding='utf8').read()) con.close() + + +@pytest.fixture(autouse=True) +def restart_englishpal(restore_sqlite_database): + (Path(__file__).parent / '../main.py').touch() + time.sleep(1)