mirror of
https://github.com/venthur/blag.git
synced 2025-11-25 20:52:43 +00:00
remove warning in test due to threading race condition we don´t care
about
This commit is contained in:
@@ -72,7 +72,7 @@ def autoreload(args):
|
|||||||
mtime = get_last_modified(dirs)
|
mtime = get_last_modified(dirs)
|
||||||
if mtime > last_mtime:
|
if mtime > last_mtime:
|
||||||
last_mtime = mtime
|
last_mtime = mtime
|
||||||
logger.debug('Change detected, rebuilding...')
|
logger.info('Change detected, rebuilding...')
|
||||||
blag.build(args)
|
blag.build(args)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from blag import devserver
|
from blag import devserver
|
||||||
|
|
||||||
|
|
||||||
@@ -42,6 +44,7 @@ def test_autoreload_builds_immediately(args):
|
|||||||
assert t1 > t0
|
assert t1 > t0
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.filterwarnings("ignore::pytest.PytestUnhandledThreadExceptionWarning") # noqa
|
||||||
def test_autoreload(args):
|
def test_autoreload(args):
|
||||||
t = threading.Thread(target=devserver.autoreload,
|
t = threading.Thread(target=devserver.autoreload,
|
||||||
args=(args, ),
|
args=(args, ),
|
||||||
@@ -54,11 +57,10 @@ def test_autoreload(args):
|
|||||||
with open('content/test.md', 'w') as fh:
|
with open('content/test.md', 'w') as fh:
|
||||||
fh.write('boo')
|
fh.write('boo')
|
||||||
|
|
||||||
# try for 5 seconds...
|
# try for 5 seconds to see if we rebuild once...
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
t1 = devserver.get_last_modified(['build'])
|
t1 = devserver.get_last_modified(['build'])
|
||||||
print(t1)
|
|
||||||
if t1 > t0:
|
if t1 > t0:
|
||||||
break
|
break
|
||||||
assert t1 > t0
|
assert t1 > t0
|
||||||
|
|||||||
Reference in New Issue
Block a user