summaryrefslogtreecommitdiff
path: root/plac/doc/test_runp.py
diff options
context:
space:
mode:
Diffstat (limited to 'plac/doc/test_runp.py')
-rw-r--r--plac/doc/test_runp.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/plac/doc/test_runp.py b/plac/doc/test_runp.py
new file mode 100644
index 0000000..619fc1f
--- /dev/null
+++ b/plac/doc/test_runp.py
@@ -0,0 +1,24 @@
+"""
+This test should work on Linux if you have both Tkinter installed.
+"""
+
+from __future__ import with_statement
+import plac, plac_tk, time
+
+def gen(n):
+ for i in range(n):
+ yield str(i)
+ time.sleep(.1)
+
+def test():
+ tasks = plac.runp([gen(3), gen(5), gen(10)])
+ for t in tasks:
+ t.result
+ t.man.stop()
+
+def test_tkmonitor():
+ mon = plac_tk.TkMonitor('tkmon')
+ tasks = plac.runp([gen(3), gen(5), gen(10)], monitors=[mon])
+ for t in tasks:
+ t.result
+ t.man.stop()