[Python-checkins] distutils2: Logging touchups.
tarek.ziade
python-checkins at python.org
Sun Sep 19 10:20:22 CEST 2010
tarek.ziade pushed b1c8869b856c to distutils2:
http://hg.python.org/distutils2/rev/b1c8869b856c
changeset: 648:b1c8869b856c
user: ?ric Araujo <merwok at netwok.org>
date: Fri Aug 20 01:02:53 2010 +0200
summary: Logging touchups.
files: src/distutils2/command/install_distinfo.py, src/distutils2/command/test.py
diff --git a/src/distutils2/command/install_distinfo.py b/src/distutils2/command/install_distinfo.py
--- a/src/distutils2/command/install_distinfo.py
+++ b/src/distutils2/command/install_distinfo.py
@@ -90,12 +90,12 @@
self.execute(os.makedirs, (target,), "Creating " + target)
metadata_path = os.path.join(self.distinfo_dir, 'METADATA')
- log.info('Creating %s' % (metadata_path,))
+ log.info('creating %s', metadata_path)
self.distribution.metadata.write(metadata_path)
self.outputs.append(metadata_path)
installer_path = os.path.join(self.distinfo_dir, 'INSTALLER')
- log.info('Creating %s' % (installer_path,))
+ log.info('creating %s', installer_path)
f = open(installer_path, 'w')
try:
f.write(self.installer)
@@ -105,14 +105,14 @@
if self.requested:
requested_path = os.path.join(self.distinfo_dir, 'REQUESTED')
- log.info('Creating %s' % (requested_path,))
+ log.info('creating %s', requested_path)
f = open(requested_path, 'w')
f.close()
self.outputs.append(requested_path)
if not self.no_record:
record_path = os.path.join(self.distinfo_dir, 'RECORD')
- log.info('Creating %s' % (record_path,))
+ log.info('creating %s', record_path)
f = open(record_path, 'wb')
try:
writer = csv.writer(f, delimiter=',',
diff --git a/src/distutils2/command/test.py b/src/distutils2/command/test.py
--- a/src/distutils2/command/test.py
+++ b/src/distutils2/command/test.py
@@ -34,10 +34,13 @@
self.build_lib = self.get_finalized_command("build").build_lib
for requirement in self.tests_require:
if get_distribution(requirement) is None:
- self.announce("The test dependency %s is not installed which may couse the tests to fail." % requirement)
if not self.suite and not self.runner and self.get_ut_with_discovery() is None:
- raise DistutilsOptionError("No test discovery available. Please specify the 'suite' or 'runner' option or install unittest2.")
+ self.announce("test dependency %s is not installed, "
+ "tests may fail" % requirement)
+ raise DistutilsOptionError(
+ "no test discovery available, please give a 'suite' or "
+ "'runner' option or install unittest2")
def get_ut_with_discovery(self):
if hasattr(unittest.TestLoader, "discover"):
return unittest
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list