diff options
author | Ghe Rivero <ghe@debian.org> | 2012-03-10 23:19:54 +0100 |
---|---|---|
committer | Ghe Rivero <ghe@debian.org> | 2012-03-10 23:19:54 +0100 |
commit | 0f4c7647c3bf408ef86157c0619df4fda0ca45c8 (patch) | |
tree | 424674473729b24d74ca9aac70538a32f0ca1028 | |
parent | a82cebe38c64ff5cb57252a31cd940bbf93f3274 (diff) | |
parent | 84019217057d1752fba021b2bfe940af5636977d (diff) | |
download | factory-boy-0f4c7647c3bf408ef86157c0619df4fda0ca45c8.tar factory-boy-0f4c7647c3bf408ef86157c0619df4fda0ca45c8.tar.gz |
Merge tag 'v1.1.3' into debian/unstable
Release of factory_boy 1.1.3
-rw-r--r-- | MANIFEST.in | 6 | ||||
-rw-r--r-- | docs/_static/.keep_dir | 0 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tests/test_using.py | 19 |
4 files changed, 26 insertions, 1 deletions
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3912fee --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include README +include docs/Makefile +recursive-include docs *.py *.rst +include docs/_static/.keep_dir +prune docs/_build +recursive-include tests *.py diff --git a/docs/_static/.keep_dir b/docs/_static/.keep_dir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/docs/_static/.keep_dir @@ -5,7 +5,7 @@ from distutils.core import setup from distutils import cmd # Remember to change in factory/__init__.py as well! -VERSION = '1.1.2' +VERSION = '1.1.3' class test(cmd.Command): diff --git a/tests/test_using.py b/tests/test_using.py index 41b34ea..7f9f09c 100644 --- a/tests/test_using.py +++ b/tests/test_using.py @@ -780,6 +780,25 @@ class IteratorTestCase(unittest.TestCase): for i, obj in enumerate(objs): self.assertEqual(i % 5, obj.one) + def test_infinite_iterator_list_comprehension(self): + class TestObjectFactory(factory.Factory): + one = factory.InfiniteIterator([j * 3 for j in xrange(5)]) + + # Scope bleeding: j will end up in TestObjectFactory's scope. + + self.assertRaises(TypeError, TestObjectFactory.build) + + def test_infinite_iterator_list_comprehension_protected(self): + class TestObjectFactory(factory.Factory): + one = factory.InfiniteIterator([_j * 3 for _j in xrange(5)]) + + # Scope bleeding : _j will end up in TestObjectFactory's scope. + # But factory_boy ignores it, as a protected variable. + objs = TestObjectFactory.build_batch(20) + + for i, obj in enumerate(objs): + self.assertEqual(3 * (i % 5), obj.one) + def test_iterator_decorator(self): class TestObjectFactory(factory.Factory): @factory.iterator |