mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
move test code behind env var
This commit is contained in:
parent
97300a16bf
commit
69448365c4
2 changed files with 10 additions and 1 deletions
|
@ -30,6 +30,7 @@ from anki.media import MediaManager, media_paths_from_col_path
|
|||
from anki.models import ModelManager
|
||||
from anki.notes import Note
|
||||
from anki.sched import Scheduler as V1Scheduler
|
||||
from anki.scheduler import Scheduler as V2TestScheduler
|
||||
from anki.schedv2 import Scheduler as V2Scheduler
|
||||
from anki.sync import SyncAuth, SyncOutput, SyncStatus
|
||||
from anki.tags import TagManager
|
||||
|
@ -138,7 +139,10 @@ class Collection:
|
|||
if ver == 1:
|
||||
self.sched = V1Scheduler(self)
|
||||
elif ver == 2:
|
||||
self.sched = V2Scheduler(self)
|
||||
if os.getenv("TEST_SCHEDULER"):
|
||||
self.sched = V2TestScheduler(self) # type: ignore
|
||||
else:
|
||||
self.sched = V2Scheduler(self)
|
||||
|
||||
def upgrade_to_v2_scheduler(self) -> None:
|
||||
self._backend.upgrade_scheduler()
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
# Copyright: Ankitects Pty Ltd and contributors
|
||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
"""
|
||||
This file contains experimental scheduler changes, and is not currently
|
||||
used by Anki.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pprint
|
||||
|
|
Loading…
Reference in a new issue