remove warning in test due to threading race condition we don´t care

about
This commit is contained in:
Bastian Venthur
2021-11-06 14:51:46 +01:00
parent 4f1632e3cd
commit 78316725cf
2 changed files with 5 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ def autoreload(args):
mtime = get_last_modified(dirs)
if mtime > last_mtime:
last_mtime = mtime
logger.debug('Change detected, rebuilding...')
logger.info('Change detected, rebuilding...')
blag.build(args)
time.sleep(1)

View File

@@ -1,6 +1,8 @@
import time
import threading
import pytest
from blag import devserver
@@ -42,6 +44,7 @@ def test_autoreload_builds_immediately(args):
assert t1 > t0
@pytest.mark.filterwarnings("ignore::pytest.PytestUnhandledThreadExceptionWarning") # noqa
def test_autoreload(args):
t = threading.Thread(target=devserver.autoreload,
args=(args, ),
@@ -54,11 +57,10 @@ def test_autoreload(args):
with open('content/test.md', 'w') as fh:
fh.write('boo')
# try for 5 seconds...
# try for 5 seconds to see if we rebuild once...
for i in range(5):
time.sleep(1)
t1 = devserver.get_last_modified(['build'])
print(t1)
if t1 > t0:
break
assert t1 > t0