Skip to content
Snippets Groups Projects
Commit ecbbc527 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

add __len__ to FutureCollection

parent 1a12d106
No related branches found
No related tags found
No related merge requests found
# v2.18.11
* unit tests migrated to CircleCI
* added __len__ to FutureCollection
......@@ -22,6 +22,9 @@ class FutureCollection:
futures = list(futures)
self.futures = futures
def __len__(self) -> int:
return len(self.futures)
def __getitem__(self, n: int) -> Future:
return self.futures[n]
......
......@@ -50,6 +50,8 @@ class TestConcurrent(unittest.TestCase):
fc += [PythonFuture(), PythonFuture()]
fc = fc + FutureCollection([PythonFuture()])
fc + [PythonFuture(), PythonFuture()]
fc += FutureCollection([])
self.assertGreaterEqual(len(fc), 3)
def test_future_collection_callbacks_one(self):
a = {'count': 0}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment