summaryrefslogtreecommitdiff
path: root/tests/test_coroutine.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_coroutine.py')
-rw-r--r--tests/test_coroutine.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/test_coroutine.py b/tests/test_coroutine.py
index fe6c832..38de7a3 100644
--- a/tests/test_coroutine.py
+++ b/tests/test_coroutine.py
@@ -32,7 +32,7 @@ def line_count(s):
class CoroutineTest(CoverageTest):
"""Tests of the coroutine support in coverage.py."""
- LIMIT = 1000
+ LIMIT = 3 # Should be 1000, but this gives me a reasonable amount of output.
# The code common to all the concurrency models.
COMMON = """
@@ -101,7 +101,7 @@ class CoroutineTest(CoverageTest):
self.make_file("try_it.py", code)
- out = self.run_command("coverage run --timid %s try_it.py" % args)
+ out = self.run_command("coverage run %s try_it.py" % args)
expected_out = "%d\n" % (sum(range(self.LIMIT)))
self.assertEqual(out, expected_out)
@@ -129,13 +129,26 @@ class CoroutineTest(CoverageTest):
self.try_some_code(self.EVENTLET, "--coroutine=eventlet")
def test_gevent(self):
- raise SkipTest("Still not sure why gevent isn't working...")
+ #raise SkipTest("Still not sure why gevent isn't working...")
if gevent is None:
raise SkipTest("No gevent available")
self.try_some_code(self.GEVENT, "--coroutine=gevent")
+ def test_gevent_badly(self):
+ # This test shouldn't pass. It should fail because we are running
+ # gevent code without the --coroutine=gevent flag. It's here so I can
+ # see how gevent code looks when it isn't measured properly. The C
+ # extension implementation of coroutining is currently acting precisely
+ # as if no coroutine support is available (demonstrated by this test),
+ # and I don't know why. This test is part of me debugging that
+ # problem.
+ if gevent is None:
+ raise SkipTest("No gevent available")
+
+ self.try_some_code(self.GEVENT, "")
+
def print_simple_annotation(code, linenos):
"""Print the lines in `code` with X for each line number in `linenos`."""