summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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