Show More
@@ -15,9 +15,6 b'' | |||
|
15 | 15 | # Stdlib imports |
|
16 | 16 | import time |
|
17 | 17 | |
|
18 | # Third-party imports | |
|
19 | import nose.tools as nt | |
|
20 | ||
|
21 | 18 | # Our own imports |
|
22 | 19 | from IPython.lib import backgroundjobs as bg |
|
23 | 20 | |
@@ -49,7 +46,7 b' def test_result():' | |||
|
49 | 46 | jobs = bg.BackgroundJobManager() |
|
50 | 47 | j = jobs.new(sleeper) |
|
51 | 48 | j.join() |
|
52 |
|
|
|
49 | assert j.result["interval"] == t_short | |
|
53 | 50 | |
|
54 | 51 | |
|
55 | 52 | def test_flush(): |
@@ -57,10 +54,10 b' def test_flush():' | |||
|
57 | 54 | jobs = bg.BackgroundJobManager() |
|
58 | 55 | j = jobs.new(sleeper) |
|
59 | 56 | j.join() |
|
60 |
|
|
|
61 |
|
|
|
57 | assert len(jobs.completed) == 1 | |
|
58 | assert len(jobs.dead) == 0 | |
|
62 | 59 | jobs.flush() |
|
63 |
|
|
|
60 | assert len(jobs.completed) == 0 | |
|
64 | 61 | |
|
65 | 62 | |
|
66 | 63 | def test_dead(): |
@@ -68,10 +65,10 b' def test_dead():' | |||
|
68 | 65 | jobs = bg.BackgroundJobManager() |
|
69 | 66 | j = jobs.new(crasher) |
|
70 | 67 | j.join() |
|
71 |
|
|
|
72 |
|
|
|
68 | assert len(jobs.completed) == 0 | |
|
69 | assert len(jobs.dead) == 1 | |
|
73 | 70 | jobs.flush() |
|
74 |
|
|
|
71 | assert len(jobs.dead) == 0 | |
|
75 | 72 | |
|
76 | 73 | |
|
77 | 74 | def test_longer(): |
@@ -81,8 +78,8 b' def test_longer():' | |||
|
81 | 78 | # job as running, but not so long that it makes the test suite noticeably |
|
82 | 79 | # slower. |
|
83 | 80 | j = jobs.new(sleeper, 0.1) |
|
84 |
|
|
|
85 |
|
|
|
81 | assert len(jobs.running) == 1 | |
|
82 | assert len(jobs.completed) == 0 | |
|
86 | 83 | j.join() |
|
87 |
|
|
|
88 |
|
|
|
84 | assert len(jobs.running) == 0 | |
|
85 | assert len(jobs.completed) == 1 |
General Comments 0
You need to be logged in to leave comments.
Login now