diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-07 23:49:20 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-07 23:49:20 +0200 |
commit | 3e2ba9c2028f21d11988558f3557905d21e93808 (patch) | |
tree | ac2426a03dbc538fb970cd4fd22a404edb68ce53 /test/git/async/test_pool.py | |
parent | be06e87433685b5ea9cfcc131ab89c56cf8292f2 (diff) | |
parent | 898d47d1711accdfded8ee470520fdb96fb12d46 (diff) | |
download | gitpython-3e2ba9c2028f21d11988558f3557905d21e93808.tar.gz |
Merge branch 'stasks' into async
Diffstat (limited to 'test/git/async/test_pool.py')
-rw-r--r-- | test/git/async/test_pool.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py index 2b45727c..29c13188 100644 --- a/test/git/async/test_pool.py +++ b/test/git/async/test_pool.py @@ -36,7 +36,7 @@ class TestThreadTaskNode(InputIteratorThreadTask): self.plock.release() super(TestThreadTaskNode, self).process(count) - def _assert(self, pc, fc): + def _assert(self, pc, fc, check_scheduled=False): """Assert for num process counts (pc) and num function counts (fc) :return: self""" self.plock.acquire() @@ -49,6 +49,10 @@ class TestThreadTaskNode(InputIteratorThreadTask): print self.item_count, fc assert self.item_count == fc self.lock.release() + + # if we read all, we can't really use scheduled items + if check_scheduled: + assert self._scheduled_items == 0 assert not self.error() return self @@ -184,7 +188,7 @@ class TestThreadPool(TestBase): else: assert rc.read(1)[0] == i # END for each item - task._assert(ni / task.min_count + 1, ni) + task._assert(ni / task.min_count, ni) del(rc) assert p.num_tasks() == null_tasks |