Skip to content

Commit

Permalink
MagicMockFuture inherit from concurrent.futures.Future not _asyncio.F…
Browse files Browse the repository at this point in the history
…uture

MockFuture created from inherit the `_asyncio.Future` cause an
unexpected exception. Simply inherit it from `concurrent.futures.FUture`
to resolve it.
  • Loading branch information
unkcpz committed Jun 13, 2020
1 parent bfddb1e commit 96f4391
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions circus/tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import multiprocessing
import socket
import sysconfig
import concurrent

from unittest import skip, skipIf, TestCase, TestSuite, findTestCases # noqa: F401

Expand Down Expand Up @@ -472,8 +473,7 @@ def is_alive(self):
def stop(self):
pass


class MagicMockFuture(mock.MagicMock, tornado.concurrent.Future):
class MagicMockFuture(mock.MagicMock, concurrent.futures.Future):

def cancel(self):
return False
Expand Down

0 comments on commit 96f4391

Please sign in to comment.