summaryrefslogtreecommitdiff
path: root/mock/tests/testcallable.py
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-03-13 17:00:28 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-03-13 17:00:28 +0000
commit4837d7c35ea73e425c0d997a64e777391d6e1aa1 (patch)
tree3d0f6532dde961e17aa921b9a5e76681a0b47fff /mock/tests/testcallable.py
parentf332c94a41ebb992ae90e58c9cb61d2c5a7ef170 (diff)
parent276f8d6022c480f9f6f4804e89df5bf93aea2a2b (diff)
downloadmock-4837d7c35ea73e425c0d997a64e777391d6e1aa1.tar.gz
Revert "Upgrade python/mock to 4.0.2" am: 3381fde741 am: 276f8d6022
Change-Id: I7de1ceedb047681f0ff4bf9d58c7d06112d3c0f3
Diffstat (limited to 'mock/tests/testcallable.py')
-rw-r--r--mock/tests/testcallable.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mock/tests/testcallable.py b/mock/tests/testcallable.py
index 41715ed..729947e 100644
--- a/mock/tests/testcallable.py
+++ b/mock/tests/testcallable.py
@@ -8,8 +8,9 @@ from mock.tests.support import is_instance, X, SomeClass
from mock import (
Mock, MagicMock, NonCallableMagicMock,
NonCallableMock, patch, create_autospec,
+ CallableMixin
)
-from mock.mock import CallableMixin
+
class TestCallable(unittest.TestCase):
@@ -105,8 +106,14 @@ class TestCallable(unittest.TestCase):
class Multi(SomeClass, Sub):
pass
+ class OldStyle:
+ def __call__(self): pass
+
+ class OldStyleSub(OldStyle):
+ pass
+
for arg in 'spec', 'spec_set':
- for Klass in CallableX, Sub, Multi:
+ for Klass in CallableX, Sub, Multi, OldStyle, OldStyleSub:
with patch('%s.X' % __name__, **{arg: Klass}) as mock:
instance = mock()
mock.assert_called_once_with()