aboutsummaryrefslogtreecommitdiff
path: root/factory
diff options
context:
space:
mode:
authorChristoph Sieghart <sigi@0x2a.at>2014-01-21 20:19:21 +0100
committerRaphaƫl Barrois <raphael.barrois@polytechnique.org>2014-01-21 21:13:30 +0100
commitacadd1476d45126a8b7eb4b9a8ac4e1e1faa6478 (patch)
treebce6f5c5313d99dbd0b85e20adaf6ede71f8bf83 /factory
parent0c29413e374147cc258c329ab50d96a4cb0c675f (diff)
downloadfactory-boy-acadd1476d45126a8b7eb4b9a8ac4e1e1faa6478.tar
factory-boy-acadd1476d45126a8b7eb4b9a8ac4e1e1faa6478.tar.gz
Fix bug in LazyStub.__getattr__
When run with optimizations turned on, the assert statement is not executed. This results in incorrect behaviour.
Diffstat (limited to 'factory')
-rw-r--r--factory/containers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/factory/containers.py b/factory/containers.py
index 7a4c5db..4537e44 100644
--- a/factory/containers.py
+++ b/factory/containers.py
@@ -103,7 +103,8 @@ class LazyStub(object):
if isinstance(val, LazyValue):
self.__pending.append(name)
val = val.evaluate(self, self.__containers)
- assert name == self.__pending.pop()
+ last = self.__pending.pop()
+ assert name == last
self.__values[name] = val
return val
else: