Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MutableFuture name collision with Future base class (#272)
Fixes #271 Review: @BrooksCampbell
- Loading branch information
Showing
2 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from __future__ import absolute_import | ||
|
||
from concurrent.futures import Future | ||
import pytest | ||
|
||
from labrad.concurrent import MutableFuture | ||
|
||
|
||
def test_mutable_future(): | ||
f = Future() | ||
mf = MutableFuture(f) | ||
f.set_result(1) | ||
assert mf.result() == 1 | ||
|
||
|
||
def test_mutable_future_on_already_completed_future(): | ||
f = Future() | ||
f.set_result(1) | ||
mf = MutableFuture(f) | ||
assert mf.result() == 1 | ||
|
||
|
||
if __name__ == '__main__': | ||
pytest.main(['-v', __file__]) |