Make sure each test can be run standalone (./python Lib/distutils/tests/x.py)

This commit is contained in:
Éric Araujo 2010-11-06 02:44:43 +00:00
parent 1c5054996f
commit 70ec44a773
41 changed files with 86 additions and 56 deletions

View file

@ -1,7 +1,7 @@
"""Tests for distutils.cmd."""
import unittest
import os
from test.support import captured_stdout
from test.support import captured_stdout, run_unittest
from distutils.cmd import Command
from distutils.dist import Distribution
@ -99,7 +99,7 @@ class CommandTestCase(unittest.TestCase):
def test_ensure_dirname(self):
cmd = self.cmd
cmd.option1 = os.path.dirname(__file__)
cmd.option1 = os.path.dirname(__file__) or os.curdir
cmd.ensure_dirname('option1')
cmd.option2 = 'xxx'
self.assertRaises(DistutilsOptionError, cmd.ensure_dirname, 'option2')
@ -124,4 +124,4 @@ def test_suite():
return unittest.makeSuite(CommandTestCase)
if __name__ == '__main__':
test_support.run_unittest(test_suite())
run_unittest(test_suite())