Merge branch 'Alpha-snapshot20230621' into Bug544-TangXinyuan

# Conflicts:
#	app/test/conftest.py
pull/105/head
AliasJeff 2024-04-10 22:09:27 +08:00
commit 93264da3d9
1 changed files with 9 additions and 1 deletions

View File

@ -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)