summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--factory/containers.py2
-rw-r--r--factory/declarations.py2
-rw-r--r--tests/test_containers.py2
-rw-r--r--tests/test_using.py4
4 files changed, 5 insertions, 5 deletions
diff --git a/factory/containers.py b/factory/containers.py
index 46a647f..4ceb07f 100644
--- a/factory/containers.py
+++ b/factory/containers.py
@@ -62,7 +62,7 @@ class LazyStub(object):
def __str__(self):
return '<LazyStub for %s with %s>' % (
- self.__target_class.__name__, self.__attrs.keys())
+ self.__target_class.__name__, list(self.__attrs.keys()))
def __fill__(self):
"""Fill this LazyStub, computing values of all defined attributes.
diff --git a/factory/declarations.py b/factory/declarations.py
index 77000f2..50a826f 100644
--- a/factory/declarations.py
+++ b/factory/declarations.py
@@ -129,7 +129,7 @@ class Iterator(OrderedDeclaration):
self.iterator = iter(iterator)
def evaluate(self, sequence, obj, containers=()):
- return self.iterator.next()
+ return next(self.iterator)
class InfiniteIterator(Iterator):
diff --git a/tests/test_containers.py b/tests/test_containers.py
index b1ed6ed..139e973 100644
--- a/tests/test_containers.py
+++ b/tests/test_containers.py
@@ -342,7 +342,7 @@ class AttributeBuilderTestCase(unittest.TestCase):
ab = containers.AttributeBuilder(FakeFactory, {'one__blah': 1, 'two__bar': 2})
self.assertTrue(ab.has_subfields(sf))
- self.assertEqual(['one'], ab._subfields.keys())
+ self.assertEqual(['one'], list(ab._subfields.keys()))
self.assertEqual(2, ab._attrs['two__bar'])
def test_sub_factory(self):
diff --git a/tests/test_using.py b/tests/test_using.py
index 112604d..ad62113 100644
--- a/tests/test_using.py
+++ b/tests/test_using.py
@@ -1220,13 +1220,13 @@ class CircularTestCase(unittest.TestCase):
def test_example(self):
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
- from cyclic import foo
+ from .cyclic import foo
f = foo.FooFactory.build(bar__foo=None)
self.assertEqual(42, f.x)
self.assertEqual(13, f.bar.y)
self.assertIsNone(f.bar.foo)
- from cyclic import bar
+ from .cyclic import bar
b = bar.BarFactory.build(foo__bar__foo__bar=None)
self.assertEqual(13, b.y)
self.assertEqual(42, b.foo.x)