summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-09-24 21:03:16 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-09-24 21:03:16 -0400
commit7b5457967f256696d3b6c936e81436aa60b4b409 (patch)
tree6cc4e2517a408a730a525c4ee98ad38f3a532cff /tests
parent2eb5fe3be624d8f970d0394d32a1f2fa148a9372 (diff)
downloadpython-coveragepy-git-7b5457967f256696d3b6c936e81436aa60b4b409.tar.gz
"concurrency" is a better name that "coroutine"
--HG-- rename : tests/test_coroutine.py => tests/test_concurrency.py
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cmdline.py2
-rw-r--r--tests/test_concurrency.py (renamed from tests/test_coroutine.py)34
2 files changed, 18 insertions, 18 deletions
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index 08f7937a..bf96f27e 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -20,7 +20,7 @@ class CmdLineTest(CoverageTest):
defaults.coverage(
cover_pylib=None, data_suffix=None, timid=None, branch=None,
config_file=True, source=None, include=None, omit=None, debug=None,
- coroutine=None,
+ concurrency=None,
)
defaults.annotate(
directory=None, ignore_errors=None, include=None, omit=None, morfs=[],
diff --git a/tests/test_coroutine.py b/tests/test_concurrency.py
index 4abdd6f6..5ea756f6 100644
--- a/tests/test_coroutine.py
+++ b/tests/test_concurrency.py
@@ -1,4 +1,4 @@
-"""Tests for coroutining."""
+"""Tests for concurrency libraries."""
import os, os.path, sys, threading
@@ -36,8 +36,8 @@ def line_count(s):
return sum(1 for l in s.splitlines() if code_line(l))
-class CoroutineTest(CoverageTest):
- """Tests of the coroutine support in coverage.py."""
+class ConcurrencyTest(CoverageTest):
+ """Tests of the concurrency support in coverage.py."""
LIMIT = 1000
@@ -103,7 +103,7 @@ class CoroutineTest(CoverageTest):
import gevent.queue as queue
""" + COMMON
- # Uncomplicated code that doesn't use any of the coroutining stuff, to test
+ # Uncomplicated code that doesn't use any of the concurrency stuff, to test
# the simple case under each of the regimes.
SIMPLE = """\
total = 0
@@ -112,32 +112,32 @@ class CoroutineTest(CoverageTest):
print(total)
""".format(LIMIT=LIMIT)
- def try_some_code(self, code, coroutine, the_module, expected_out=None):
- """Run some coroutine testing code and see that it was all covered.
+ def try_some_code(self, code, concurrency, the_module, expected_out=None):
+ """Run some concurrency testing code and see that it was all covered.
- `code` is the Python code to execute. `coroutine` is the name of the
- coroutine regime to test it under. `the_module` is the imported module
- that must be available for this to work at all. `expected_out` is the
- text we expect the code to produce.
+ `code` is the Python code to execute. `concurrency` is the name of
+ the concurrency regime to test it under. `the_module` is the imported
+ module that must be available for this to work at all. `expected_out`
+ is the text we expect the code to produce.
"""
self.make_file("try_it.py", code)
- cmd = "coverage run --coroutine=%s try_it.py" % coroutine
+ cmd = "coverage run --concurrency=%s try_it.py" % concurrency
out = self.run_command(cmd)
if not the_module:
# We don't even have the underlying module installed, we expect
# coverage to alert us to this fact.
expected_out = (
- "Couldn't trace with coroutine=%s, "
- "the module isn't installed.\n" % coroutine
+ "Couldn't trace with concurrency=%s, "
+ "the module isn't installed.\n" % concurrency
)
self.assertEqual(out, expected_out)
- elif C_TRACER or coroutine == "thread":
+ elif C_TRACER or concurrency == "thread":
# We can fully measure the code if we are using the C tracer, which
- # can support all the coroutining, or if we are using threads.
+ # can support all the concurrency, or if we are using threads.
if expected_out is None:
expected_out = "%d\n" % (sum(range(self.LIMIT)))
self.assertEqual(out, expected_out)
@@ -157,8 +157,8 @@ class CoroutineTest(CoverageTest):
self.assertEqual(data.summary()['try_it.py'], lines)
else:
expected_out = (
- "Can't support coroutine=%s with PyTracer, "
- "only threads are supported\n" % coroutine
+ "Can't support concurrency=%s with PyTracer, "
+ "only threads are supported\n" % concurrency
)
self.assertEqual(out, expected_out)