Comments (5)
Original comment by [email protected]
on 7 Oct 2010 at 4:37
Attachments:
from mock.
This is due to an infinite recursion in Mock.__getattr__. Add this to the top
to fix the problem:
def __getattr__(self, name):
if name == "_methods":
raise AttributeError(name)
Original comment by [email protected]
on 7 Oct 2010 at 2:12
from mock.
Original comment by fuzzyman
on 7 Oct 2010 at 2:23
- Changed state: Accepted
- Added labels: Milestone-Release0.7
from mock.
PS: a longer write-up of the issue:
http://nedbatchelder.com/blog/201010/surprising_getattr_recursion.html
Original comment by [email protected]
on 8 Oct 2010 at 10:35
from mock.
Fixed, but the test is a bit brutal (call sys.setrecursionlimit(sys.maxint) and
copying a Mock segfaults without the fix). I did try the sys.settrace trick,
but for some reason that didn't work (the trace function wasn't removed during
the test even after the recursion).
Original comment by fuzzyman
on 18 Oct 2010 at 9:36
- Changed state: Fixed
from mock.
Related Issues (20)
- Crash on comparing call_args with long strings
- Bug on call() comparison HOT 7
- Cannot autospec mock builtins.print in python3.4
- deepcopying property of mock with spec breaks mocked calls
- Assigning mock property as another mock fails? HOT 3
- Invalid calls info when mock object called with updated dict as arg HOT 2
- Call stack on function calls making changes to dictionary fails at assertions of arguments because the dictionary changes. HOT 4
- Make call assertion errors align visually HOT 1
- Remove redundant code
- mock patch autospec doesn't work on staticmethods
- side_effect Does Not Work With autospec HOT 3
- Unexpected behaviour of assert_has_calls with empty list as argument
- copy.copy(sentinel.foo) is not sentinel.foo
- assert_called_with scope issues
- Include wheels on the PyPI distribution
- MagicMock.__truediv__ doesn't work on python3
- assert_has_calls does NOT consider order HOT 1
- create_autospec causes error in python3.4 HOT 2
- Cannot patch unittest.main.os because of how unittest imports main HOT 1
- "wraps" should work with "side_effect"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mock.