Merge branch 'Alpha-snapshot20230621' into Bug544-TangXinyuan
# Conflicts: # app/test/conftest.pypull/105/head
commit
93264da3d9
|
@ -1,6 +1,8 @@
|
||||||
import pytest
|
import pytest
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import time
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -23,7 +25,7 @@ def PASSWORD():
|
||||||
return 'l0ve1t'
|
return 'l0ve1t'
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture
|
||||||
def restore_sqlite_database():
|
def restore_sqlite_database():
|
||||||
'''
|
'''
|
||||||
Automatically restore SQLite database file app/db/wordfreqapp.db
|
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('DROP TABLE IF EXISTS article;')
|
||||||
con.executescript(open('../static/wordfreqapp.sql', encoding='utf8').read())
|
con.executescript(open('../static/wordfreqapp.sql', encoding='utf8').read())
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def restart_englishpal(restore_sqlite_database):
|
||||||
|
(Path(__file__).parent / '../main.py').touch()
|
||||||
|
time.sleep(1)
|
||||||
|
|
Loading…
Reference in New Issue