Disable FSRS by default in test helper function

Add Config import and disable FSRS in getEmptyCol() helper function.
This ensures all tests using this helper function have FSRS disabled
by default, maintaining compatibility with legacy scheduler tests.
This commit is contained in:
Jarrett Ye 2025-10-15 03:31:04 +08:00
parent 9d2ab84052
commit 9c8f0ffc7d

View file

@ -9,6 +9,7 @@ import tempfile
import time import time
from anki.collection import Collection as aopen from anki.collection import Collection as aopen
from anki.config import Config
# Between 2-4AM, shift the time back so test assumptions hold. # Between 2-4AM, shift the time back so test assumptions hold.
lt = time.localtime() lt = time.localtime()
@ -49,6 +50,8 @@ def getEmptyCol():
(fd, path) = tempfile.mkstemp(suffix=".anki2") (fd, path) = tempfile.mkstemp(suffix=".anki2")
shutil.copy(_emptyCol, path) shutil.copy(_emptyCol, path)
col = aopen(path) col = aopen(path)
# Disable FSRS for legacy scheduler tests
col.set_config_bool(Config.Bool.FSRS, False, undoable=False)
return col return col