Skip to content

Commit e5c22b8

Browse files
committed
Run tests against CRNS
1 parent 001d0f3 commit e5c22b8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
compiling = False
2+
noticed = False
3+
notice_delay = 0.3
4+
import time
5+
import sys
6+
import threading
7+
from importlib.util import find_spec
8+
if find_spec("pyximport") and find_spec("cython"):
9+
import pyximport; pyxloader = pyximport.install(pyimport=True, language_level=3)[1]
10+
11+
def notice_job():
12+
global noticed
13+
started = time.time()
14+
while compiling:
15+
if time.time() > started+notice_delay and compiling:
16+
noticed = True
17+
print("Compiling RNS object code... ", end="")
18+
sys.stdout.flush()
19+
break
20+
time.sleep(0.1)
21+
22+
23+
compiling = True
24+
threading.Thread(target=notice_job, daemon=True).start()
25+
import RNS; compiling = False
26+
if noticed: print("Done."); sys.stdout.flush()

0 commit comments

Comments
 (0)