[Python-checkins] distutils2: Branch merge
tarek.ziade
python-checkins at python.org
Sun Aug 8 11:50:44 CEST 2010
tarek.ziade pushed bf63d656f732 to distutils2:
http://hg.python.org/distutils2/rev/bf63d656f732
changeset: 398:bf63d656f732
parent: 397:2b3bd798734a
parent: 396:6dd1d6de357c
user: ?ric Araujo <merwok at netwok.org>
date: Fri Jul 30 07:29:06 2010 +0200
summary: Branch merge
files:
diff --git a/src/distutils2/dist.py b/src/distutils2/dist.py
--- a/src/distutils2/dist.py
+++ b/src/distutils2/dist.py
@@ -148,8 +148,7 @@
# Store the distribution meta-data (name, version, author, and so
# forth) in a separate object -- we're getting to have enough
# information here (and enough command-line options) that it's
- # worth it. Also delegate 'get_XXX()' methods to the 'metadata'
- # object in a sneaky and underhanded (but efficient!) way.
+ # worth it.
self.metadata = DistributionMetadata()
# 'cmdclass' maps command names to class objects, so we
diff --git a/src/runtests-cov.py b/src/runtests-cov.py
--- a/src/runtests-cov.py
+++ b/src/runtests-cov.py
@@ -8,6 +8,7 @@
from os.path import dirname, islink, realpath
from optparse import OptionParser
+
def ignore_prefixes(module):
""" Return a list of prefixes to ignore in the coverage report if
we want to completely skip `module`.
@@ -16,16 +17,17 @@
# distributions, such a Ubuntu, really like to build link farm in
# /usr/lib in order to save a few bytes on the disk.
dirnames = [dirname(module.__file__)]
-
+
pymod = module.__file__.rstrip("c")
if islink(pymod):
dirnames.append(dirname(realpath(pymod)))
return dirnames
+
def parse_opts():
parser = OptionParser(usage="%prog [OPTIONS]",
description="run the distutils2 unittests")
-
+
parser.add_option("-q", "--quiet", help="do not print verbose messages",
action="store_true", default=False)
parser.add_option("-c", "--coverage", action="store_true", default=False,
@@ -36,10 +38,11 @@
default=False,
help=("Show line numbers of statements in each module "
"that weren't executed."))
-
+
opts, args = parser.parse_args()
return opts, args
+
def coverage_report(opts):
import coverage
from distutils2.tests.support import unittest
@@ -89,6 +92,7 @@
return ret
+
def run_tests(verbose):
import distutils2.tests
from distutils2.tests import run_unittest, reap_children, TestFailed
@@ -108,12 +112,11 @@
finally:
reap_children()
+
if __name__ == "__main__":
try:
from distutils2.tests.support import unittest
except ImportError:
sys.stderr.write('Error: You have to install unittest2')
sys.exit(1)
-
sys.exit(test_main())
-
diff --git a/src/runtests.py b/src/runtests.py
--- a/src/runtests.py
+++ b/src/runtests.py
@@ -1,9 +1,12 @@
+#!/usr/bin/env python
"""Tests for distutils2.
The tests for distutils2 are defined in the distutils2.tests package.
"""
+
import sys
+
def test_main():
import distutils2.tests
from distutils2.tests import run_unittest, reap_children, TestFailed
@@ -23,12 +26,11 @@
finally:
reap_children()
+
if __name__ == "__main__":
try:
from distutils2.tests.support import unittest
except ImportError:
sys.stderr.write('Error: You have to install unittest2')
sys.exit(1)
-
sys.exit(test_main())
-
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list