diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-07-20 21:52:53 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-07-20 21:52:53 -0400 |
commit | f1b8cda800984363fc58e809326d2acef86a1d6a (patch) | |
tree | f50eace87c69e2a699d7f42845ce1a2ffea5094a /igor.py | |
parent | 5504149935b6857f4b4bcab2b038042e222d041c (diff) | |
download | python-coveragepy-git-f1b8cda800984363fc58e809326d2acef86a1d6a.tar.gz |
Move the banner into igor.py
Diffstat (limited to 'igor.py')
-rw-r--r-- | igor.py | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -8,9 +8,11 @@ of in shell scripts, batch files, or Makefiles. import fnmatch import glob import os +import platform import sys import zipfile + def do_remove_extension(args): """Remove the compiled C extension, no matter what its name.""" @@ -31,7 +33,13 @@ def do_remove_extension(args): def do_test_with_tracer(args): """Run nosetests with a particular tracer.""" import nose.core - os.environ["COVERAGE_TEST_TRACER"] = args[0] + tracer = args[0] + if tracer == "py": + label = "with Python tracer" + else: + label = "with C tracer" + print_banner(label) + os.environ["COVERAGE_TEST_TRACER"] = tracer nose_args = ["nosetests"] + args[1:] nose.core.main(argv=nose_args) @@ -79,6 +87,22 @@ def do_check_eol(args): check_files(".", ["*.txt"]) +def print_banner(label): + """Print the version of Python.""" + try: + impl = platform.python_implementation() + except AttributeError: + impl = "Python" + + version = platform.python_version() + + if '__pypy__' in sys.builtin_module_names: + pypy_version = ".".join([str(v) for v in sys.pypy_version_info]) + version += " (pypy %s)" % pypy_version + + print('=== %s %s %s (%s) ===' % (impl, version, label, sys.executable)) + + def main(args): handler = globals().get('do_'+args[0]) if handler is None: |