summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-08-17 17:07:30 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-11-15 00:01:24 +0100
commitd4fcbd31f192420898923ed9d8e956acaed8396e (patch)
tree969207580b08b1cfc3382904eb8657915e3d0ba9
parentb093cc6a35c884b926e0c2bc5928b330cccd4e03 (diff)
downloadfactory-boy-d4fcbd31f192420898923ed9d8e956acaed8396e.tar
factory-boy-d4fcbd31f192420898923ed9d8e956acaed8396e.tar.gz
[py3] Disable 'scope bleeding' test on py3.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
-rw-r--r--tests/compat.py4
-rw-r--r--tests/test_using.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/compat.py b/tests/compat.py
index 15fa3ae..813b2e4 100644
--- a/tests/compat.py
+++ b/tests/compat.py
@@ -21,6 +21,10 @@
"""Compatibility tools for tests"""
+import sys
+
+is_python2 = (sys.version_info[0] == 2)
+
try:
import unittest2 as unittest
except ImportError:
diff --git a/tests/test_using.py b/tests/test_using.py
index 7cebacb..3658d28 100644
--- a/tests/test_using.py
+++ b/tests/test_using.py
@@ -28,7 +28,7 @@ import warnings
import factory
-from .compat import unittest
+from .compat import is_python2, unittest
class TestObject(object):
@@ -1038,7 +1038,8 @@ class IteratorTestCase(unittest.TestCase):
for i, obj in enumerate(objs):
self.assertEqual(i % 5, obj.one)
- def test_infinite_iterator_list_comprehension(self):
+ @unittest.skipUnless(is_python2, "Scope bleeding fixed in Python3+")
+ def test_infinite_iterator_list_comprehension_scope_bleeding(self):
class TestObjectFactory(factory.Factory):
FACTORY_FOR = TestObject