summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-08-17 17:08:33 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-11-15 00:01:24 +0100
commitb152ba79ab355c231b6e5fd852bad546e06208d9 (patch)
tree8ce318144cf3455acb60be2d93ffabd3d368fa21
parentd4fcbd31f192420898923ed9d8e956acaed8396e (diff)
downloadfactory-boy-b152ba79ab355c231b6e5fd852bad546e06208d9.tar
factory-boy-b152ba79ab355c231b6e5fd852bad546e06208d9.tar.gz
[py3] Rename xrange to range
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
-rw-r--r--factory/base.py6
-rw-r--r--tests/test_using.py12
2 files changed, 9 insertions, 9 deletions
diff --git a/factory/base.py b/factory/base.py
index 240170c..a5056fd 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -369,7 +369,7 @@ class BaseFactory(object):
Returns:
object list: the built instances
"""
- return [cls.build(**kwargs) for _ in xrange(size)]
+ return [cls.build(**kwargs) for _ in range(size)]
@classmethod
def create(cls, **kwargs):
@@ -386,7 +386,7 @@ class BaseFactory(object):
Returns:
object list: the created instances
"""
- return [cls.create(**kwargs) for _ in xrange(size)]
+ return [cls.create(**kwargs) for _ in range(size)]
@classmethod
def stub(cls, **kwargs):
@@ -410,7 +410,7 @@ class BaseFactory(object):
Returns:
object list: the stubbed instances
"""
- return [cls.stub(**kwargs) for _ in xrange(size)]
+ return [cls.stub(**kwargs) for _ in range(size)]
@classmethod
def generate(cls, strategy, **kwargs):
diff --git a/tests/test_using.py b/tests/test_using.py
index 3658d28..112604d 100644
--- a/tests/test_using.py
+++ b/tests/test_using.py
@@ -1020,7 +1020,7 @@ class IteratorTestCase(unittest.TestCase):
class TestObjectFactory(factory.Factory):
FACTORY_FOR = TestObject
- one = factory.Iterator(xrange(10, 30))
+ one = factory.Iterator(range(10, 30))
objs = TestObjectFactory.build_batch(20)
@@ -1031,7 +1031,7 @@ class IteratorTestCase(unittest.TestCase):
class TestObjectFactory(factory.Factory):
FACTORY_FOR = TestObject
- one = factory.InfiniteIterator(xrange(5))
+ one = factory.InfiniteIterator(range(5))
objs = TestObjectFactory.build_batch(20)
@@ -1043,7 +1043,7 @@ class IteratorTestCase(unittest.TestCase):
class TestObjectFactory(factory.Factory):
FACTORY_FOR = TestObject
- one = factory.InfiniteIterator([j * 3 for j in xrange(5)])
+ one = factory.InfiniteIterator([j * 3 for j in range(5)])
# Scope bleeding: j will end up in TestObjectFactory's scope.
@@ -1053,7 +1053,7 @@ class IteratorTestCase(unittest.TestCase):
class TestObjectFactory(factory.Factory):
FACTORY_FOR = TestObject
- one = factory.InfiniteIterator([_j * 3 for _j in xrange(5)])
+ one = factory.InfiniteIterator([_j * 3 for _j in range(5)])
# Scope bleeding : _j will end up in TestObjectFactory's scope.
# But factory_boy ignores it, as a protected variable.
@@ -1068,7 +1068,7 @@ class IteratorTestCase(unittest.TestCase):
@factory.iterator
def one():
- for i in xrange(10, 50):
+ for i in range(10, 50):
yield i
objs = TestObjectFactory.build_batch(20)
@@ -1082,7 +1082,7 @@ class IteratorTestCase(unittest.TestCase):
@factory.infinite_iterator
def one():
- for i in xrange(5):
+ for i in range(5):
yield i
objs = TestObjectFactory.build_batch(20)