Message330434
Here's a minimal example so my comment is not totally vacuous:
```
import unittest
from unittest import mock
class Foo:
@classmethod
def bar(cls, baz):
pass
class TestFoo(unittest.TestCase):
def test_bar(self):
with unittest.mock.patch.object(Foo, "bar", autospec=True):
Foo.bar()
```
->
```
~/› python -m unittest example.py
E
======================================================================
ERROR: test_bar (example.TestFoo)
----------------------------------------------------------------------
Traceback (most recent call last):
File "example.py", line 14, in test_bar
Foo.bar()
TypeError: 'NonCallableMagicMock' object is not callable
----------------------------------------------------------------------
Ran 1 test in 0.001s
``` |
|
Date |
User |
Action |
Args |
2018-11-26 14:46:50 | tom.dalton.fanduel | set | recipients:
+ tom.dalton.fanduel, kormat, michael.foord, Claudiu.Popa, lukasz.langa, berker.peksag, epu, galuszkak, fov, kevinbenton, germanop, deanliao |
2018-11-26 14:46:50 | tom.dalton.fanduel | set | messageid: <1543243610.43.0.788709270274.issue23078@psf.upfronthosting.co.za> |
2018-11-26 14:46:50 | tom.dalton.fanduel | link | issue23078 messages |
2018-11-26 14:46:50 | tom.dalton.fanduel | create | |
|