mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
hack around race condition triggered in tests on win32
This commit is contained in:
parent
2280a0e58a
commit
252f74b19c
1 changed files with 5 additions and 1 deletions
|
@ -1,8 +1,9 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
import time
|
||||||
|
|
||||||
from tests.shared import getEmptyCol
|
from tests.shared import getEmptyCol
|
||||||
from anki.consts import MODEL_CLOZE
|
from anki.consts import MODEL_CLOZE
|
||||||
from anki.utils import stripHTML, joinFields
|
from anki.utils import stripHTML, joinFields, isWin
|
||||||
import anki.template
|
import anki.template
|
||||||
|
|
||||||
def test_modelDelete():
|
def test_modelDelete():
|
||||||
|
@ -267,6 +268,9 @@ def test_modelChange():
|
||||||
assert f.cards()[0].id == c1.id
|
assert f.cards()[0].id == c1.id
|
||||||
# delete first card
|
# delete first card
|
||||||
map = {0: None, 1: 1}
|
map = {0: None, 1: 1}
|
||||||
|
if isWin:
|
||||||
|
# The low precision timer on Windows reveals a race condition
|
||||||
|
time.sleep(0.05)
|
||||||
deck.models.change(basic, [f.id], basic, None, map)
|
deck.models.change(basic, [f.id], basic, None, map)
|
||||||
f.load()
|
f.load()
|
||||||
c0.load()
|
c0.load()
|
||||||
|
|
Loading…
Reference in a new issue