summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/__init__.py3
-rw-r--r--coverage/cmdline.py9
-rw-r--r--doc/install.rst19
-rw-r--r--tests/test_cmdline.py4
4 files changed, 23 insertions, 12 deletions
diff --git a/coverage/__init__.py b/coverage/__init__.py
index 8085b2f0..19223992 100644
--- a/coverage/__init__.py
+++ b/coverage/__init__.py
@@ -10,15 +10,12 @@ http://nedbatchelder.com/code/coverage
from coverage.version import __version__, __url__, version_info
-from coverage.collector import CTracer
from coverage.control import Coverage, process_startup
from coverage.data import CoverageData
from coverage.misc import CoverageException
from coverage.plugin import CoveragePlugin, FileTracer, FileReporter
from coverage.pytracer import PyTracer
-tracer_class = CTracer or PyTracer
-
# Backward compatibility.
coverage = Coverage
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 9e6b088f..508a4395 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -11,6 +11,7 @@ import textwrap
import traceback
from coverage import env
+from coverage.collector import CTracer
from coverage.execfile import run_python_file, run_python_module
from coverage.misc import CoverageException, ExceptionDuringRun, NoSource
from coverage.debug import info_formatter, info_header
@@ -547,6 +548,10 @@ class CoverageScript(object):
else:
help_params = dict(self.covpkg.__dict__)
help_params['program_name'] = self.program_name
+ if CTracer is not None:
+ help_params['extension_modifier'] = 'with C extension'
+ else:
+ help_params['extension_modifier'] = 'without C extension'
help_msg = textwrap.dedent(HELP_TOPICS.get(topic, '')).strip()
if help_msg:
print(help_msg.format(**help_params))
@@ -699,7 +704,7 @@ def unglob_args(args):
HELP_TOPICS = {
'help': """\
- Coverage.py, version {__version__} with {tracer_class.__name__}
+ Coverage.py, version {__version__} {extension_modifier}
Measure, collect, and report on code coverage in Python programs.
usage: {program_name} <command> [options] [args]
@@ -723,7 +728,7 @@ HELP_TOPICS = {
""",
'version': """\
- Coverage.py, version {__version__} with {tracer_class.__name__}
+ Coverage.py, version {__version__} {extension_modifier}
Documentation at {__url__}
""",
}
diff --git a/doc/install.rst b/doc/install.rst
index 133ecd02..1ccbed87 100644
--- a/doc/install.rst
+++ b/doc/install.rst
@@ -65,7 +65,7 @@ this extension: it is much faster, and is needed to support a number of
coverage.py features. You may need to install the python-dev and gcc support
files before installing coverage via pip. The exact commands depend on which
package manager you use on your operating system, which Python version you are
-using, and on the names of the packages for your distribution. For example::
+using, and the names of the packages for your distribution. For example::
$ sudo apt-get install python-dev gcc
$ sudo yum install python-devel gcc
@@ -73,6 +73,15 @@ using, and on the names of the packages for your distribution. For example::
$ sudo apt-get install python3-dev gcc
$ sudo yum install python3-devel gcc
+You can determine if you are using the extension by looking at the output of
+``coverage --version``::
+
+ $ coverage --version
+ Coverage.py, version |release| with C extension
+ Documentation at https://coverage.readthedocs.org
+
+The first line will either say "with C extension," or "without C extension."
+
Installing on Windows
---------------------
@@ -96,7 +105,7 @@ coverage.py installed properly:
.. parsed-literal::
$ coverage --version
- Coverage.py, version |release| with CTracer
+ Coverage.py, version |release| with C extension
Documentation at https://coverage.readthedocs.org
.. ifconfig:: prerelease
@@ -104,7 +113,7 @@ coverage.py installed properly:
.. parsed-literal::
$ coverage --version
- Coverage.py, version |release| with CTracer
+ Coverage.py, version |release| with C extension
Documentation at https://coverage.readthedocs.org/en/coverage-|release|
You can also invoke coverage.py as a module:
@@ -114,7 +123,7 @@ You can also invoke coverage.py as a module:
.. parsed-literal::
$ python -m coverage --version
- Coverage.py, version |release| with CTracer
+ Coverage.py, version |release| with C extension
Documentation at https://coverage.readthedocs.org
.. ifconfig:: prerelease
@@ -122,5 +131,5 @@ You can also invoke coverage.py as a module:
.. parsed-literal::
$ python -m coverage --version
- Coverage.py, version |release| with CTracer
+ Coverage.py, version |release| with C extension
Documentation at https://coverage.readthedocs.org/en/coverage-|release|
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index ebda68c3..2a0b9741 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -601,9 +601,9 @@ class CmdLineStdoutTest(BaseCmdLineTest):
out = self.stdout()
self.assertIn("ersion ", out)
if env.C_TRACER:
- self.assertIn("with CTracer", out)
+ self.assertIn("with C extension", out)
else:
- self.assertIn("with PyTracer", out)
+ self.assertIn("without C extension", out)
self.assertLess(out.count("\n"), 4)
def test_help(self):