From 252f74b19c0862fe3d612b21fc77d2b8f3c55917 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 24 Dec 2019 19:36:04 +1000 Subject: [PATCH] hack around race condition triggered in tests on win32 --- tests/test_models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_models.py b/tests/test_models.py index 9c88d7e56..daa5bfdbb 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,8 +1,9 @@ # coding: utf-8 +import time from tests.shared import getEmptyCol from anki.consts import MODEL_CLOZE -from anki.utils import stripHTML, joinFields +from anki.utils import stripHTML, joinFields, isWin import anki.template def test_modelDelete(): @@ -267,6 +268,9 @@ def test_modelChange(): assert f.cards()[0].id == c1.id # delete first card 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) f.load() c0.load()