diff options
author | Christoph Sieghart <sigi@0x2a.at> | 2014-01-21 20:19:21 +0100 |
---|---|---|
committer | Raphaƫl Barrois <raphael.barrois@polytechnique.org> | 2014-01-21 21:13:30 +0100 |
commit | acadd1476d45126a8b7eb4b9a8ac4e1e1faa6478 (patch) | |
tree | bce6f5c5313d99dbd0b85e20adaf6ede71f8bf83 | |
parent | 0c29413e374147cc258c329ab50d96a4cb0c675f (diff) | |
download | factory-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.
-rw-r--r-- | factory/containers.py | 3 |
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: |