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 | 1b87f559a823c64e5673fbd671cfd55cf9ee177f (patch) | |
tree | c875f0b5630d05544f4e023978163af2f12eb39e /igor.py | |
parent | 48379cee95cc161174d342167cc528bf4a0fd925 (diff) | |
download | python-coveragepy-1b87f559a823c64e5673fbd671cfd55cf9ee177f.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: |