Commit 9274fa3c authored by Fred Drake's avatar Fred Drake

remove excess blank lines, and apply whitespace more in line with the Python

style guidelines in PEP 8

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4040896
parent 1c904e7a
...@@ -8,4 +8,4 @@ __all__ = ['test', 'depends'] ...@@ -8,4 +8,4 @@ __all__ = ['test', 'depends']
distutils.command.__path__.extend(__path__) distutils.command.__path__.extend(__path__)
distutils.command.__all__.extend( distutils.command.__all__.extend(
[cmd for cmd in __all__ if cmd not in distutils.command.__all__] [cmd for cmd in __all__ if cmd not in distutils.command.__all__]
) )
import os.path
from distutils.command.build_py import build_py as _build_py from distutils.command.build_py import build_py as _build_py
from distutils.util import convert_path from distutils.util import convert_path
from glob import glob from glob import glob
import os.path
class build_py(_build_py):
class build_py(_build_py):
"""Enhanced 'build_py' command that includes data files with packages """Enhanced 'build_py' command that includes data files with packages
The data files are specified via a 'package_data' argument to 'setup()'. The data files are specified via a 'package_data' argument to 'setup()'.
...@@ -17,13 +18,10 @@ class build_py(_build_py): ...@@ -17,13 +18,10 @@ class build_py(_build_py):
def finalize_options(self): def finalize_options(self):
_build_py.finalize_options(self) _build_py.finalize_options(self)
self.package_data = self.distribution.package_data self.package_data = self.distribution.package_data
self.data_files = self.get_data_files() self.data_files = self.get_data_files()
def run(self): def run(self):
"""Build modules, packages, and copy data files to build directory""" """Build modules, packages, and copy data files to build directory"""
if not self.py_modules and not self.packages: if not self.py_modules and not self.packages:
return return
...@@ -36,21 +34,17 @@ class build_py(_build_py): ...@@ -36,21 +34,17 @@ class build_py(_build_py):
# Only compile actual .py files, using our base class' idea of what our # Only compile actual .py files, using our base class' idea of what our
# output files are. # output files are.
self.byte_compile(_build_py.get_outputs(self,include_bytecode=0)) self.byte_compile(_build_py.get_outputs(self, include_bytecode=0))
def get_data_files(self): def get_data_files(self):
"""Generate list of '(package,src_dir,build_dir,filenames)' tuples""" """Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
data = [] data = []
for package in self.packages: for package in self.packages:
# Locate package source directory # Locate package source directory
src_dir = self.get_package_dir(package) src_dir = self.get_package_dir(package)
# Compute package build directory # Compute package build directory
build_dir = os.path.join(*([self.build_lib]+package.split('.'))) build_dir = os.path.join(*([self.build_lib] + package.split('.')))
# Length of path to strip from found files # Length of path to strip from found files
plen = len(src_dir)+1 plen = len(src_dir)+1
...@@ -58,44 +52,30 @@ class build_py(_build_py): ...@@ -58,44 +52,30 @@ class build_py(_build_py):
# Strip directory from globbed filenames # Strip directory from globbed filenames
filenames = [ filenames = [
file[plen:] for file in self.find_data_files(package, src_dir) file[plen:] for file in self.find_data_files(package, src_dir)
] ]
data.append( (package, src_dir, build_dir, filenames) ) data.append( (package, src_dir, build_dir, filenames) )
return data return data
def find_data_files(self, package, src_dir): def find_data_files(self, package, src_dir):
"""Return filenames for package's data files in 'src_dir'""" """Return filenames for package's data files in 'src_dir'"""
globs = (self.package_data.get('', [])
globs = self.package_data.get('',[])+self.package_data.get(package,[]) + self.package_data.get(package, []))
files = [] files = []
for pattern in globs: for pattern in globs:
# Each pattern has to be converted to a platform-specific path # Each pattern has to be converted to a platform-specific path
files.extend(glob(os.path.join(src_dir, convert_path(pattern)))) files.extend(glob(os.path.join(src_dir, convert_path(pattern))))
return files return files
def build_package_data(self): def build_package_data(self):
"""Copy data files into build directory""" """Copy data files into build directory"""
lastdir = None lastdir = None
for package, src_dir, build_dir, filenames in self.data_files: for package, src_dir, build_dir, filenames in self.data_files:
for filename in filenames: for filename in filenames:
target = os.path.join(build_dir,filename) target = os.path.join(build_dir, filename)
self.mkpath(os.path.dirname(target)) self.mkpath(os.path.dirname(target))
self.copy_file(os.path.join(src_dir,filename), target) self.copy_file(os.path.join(src_dir, filename), target)
def get_outputs(self, include_bytecode=1): def get_outputs(self, include_bytecode=1):
"""Return complete list of files copied to the build directory """Return complete list of files copied to the build directory
This includes both '.py' files and data files, as well as '.pyc' and This includes both '.py' files and data files, as well as '.pyc' and
...@@ -103,21 +83,8 @@ class build_py(_build_py): ...@@ -103,21 +83,8 @@ class build_py(_build_py):
the 'install_lib' command to do its job properly, and to generate a the 'install_lib' command to do its job properly, and to generate a
correct installation manifest.) correct installation manifest.)
""" """
return _build_py.get_outputs(self, include_bytecode) + [
return _build_py.get_outputs(self,include_bytecode) + [ os.path.join(build_dir, filename)
os.path.join(build_dir,filename) for package, src_dir, build_dir,filenames in self.data_files
for package,src_dir,build_dir,filenames in self.data_files for filename in filenames
for filename in filenames ]
]
import os
import sys
from distutils.cmd import Command from distutils.cmd import Command
import os, sys
class depends(Command): class depends(Command):
"""Download and install dependencies, if needed""" """Download and install dependencies, if needed"""
description = "download and install dependencies, if needed" description = "download and install dependencies, if needed"
...@@ -13,28 +14,27 @@ class depends(Command): ...@@ -13,28 +14,27 @@ class depends(Command):
"directory where dependencies will be downloaded and built"), "directory where dependencies will be downloaded and built"),
('ignore-extra-args', 'i', ('ignore-extra-args', 'i',
"ignore options that won't be passed to child setup scripts"), "ignore options that won't be passed to child setup scripts"),
] ]
path_attrs = [ path_attrs = [
# Note: these must be in *reverse* order, as they are pushed onto the # Note: these must be in *reverse* order, as they are pushed onto the
# *front* of a copy of sys.path. # *front* of a copy of sys.path.
('install','install_libbase'), # installation base if extra_path ('install', 'install_libbase'), # installation base if extra_path
('install_lib','install_dir'), # where modules are installed ('install_lib', 'install_dir'), # where modules are installed
] ]
# Command options that can be safely passed to dependencies' setup scripts # Command options that can be safely passed to dependencies' setup scripts
safe_opts = { safe_opts = {
'install': [ 'install': [
'prefix','exec-prefix','home','install-base','install-platbase', 'prefix', 'exec-prefix', 'home', 'install-base',
'root','optimize','force','verbose','quiet' 'install-platbase', 'root', 'optimize', 'force', 'verbose', 'quiet'
], ],
'build': ['compiler','debug','force','verbose','quiet'], 'build': ['compiler', 'debug', 'force', 'verbose', 'quiet'],
} }
# Options with string arguments that are *not* directories or files, and # Options with string arguments that are *not* directories or files, and
# so should *not* have absolute-path fixups applied. # so should *not* have absolute-path fixups applied.
non_fs_opts = {'build':['compiler'] } non_fs_opts = {'build': ['compiler']}
def initialize_options(self): def initialize_options(self):
self.temp = None; self.ignore_extra_args = None self.temp = None; self.ignore_extra_args = None
...@@ -85,7 +85,7 @@ class depends(Command): ...@@ -85,7 +85,7 @@ class depends(Command):
needed = [ needed = [
dep for dep in self.distribution.requires if self.is_needed(dep) dep for dep in self.distribution.requires if self.is_needed(dep)
] ]
if not needed: if not needed:
self.announce("all dependencies are present and up-to-date") self.announce("all dependencies are present and up-to-date")
...@@ -97,7 +97,7 @@ class depends(Command): ...@@ -97,7 +97,7 @@ class depends(Command):
self.announce( self.announce(
"dependencies will be installed using:\n "+' '.join(argv)+'\n' "dependencies will be installed using:\n "+' '.join(argv)+'\n'
) )
# Alert for unsupported commands/options, unless '-i' was used # Alert for unsupported commands/options, unless '-i' was used
if self.unsafe_options: if self.unsafe_options:
...@@ -109,31 +109,26 @@ class depends(Command): ...@@ -109,31 +109,26 @@ class depends(Command):
" force the build to proceed.\nOtherwise, you will need" " force the build to proceed.\nOtherwise, you will need"
" to omit the unsupported options,\nor install the" " to omit the unsupported options,\nor install the"
" dependencies manually." " dependencies manually."
) )
# Alert the user to missing items # Alert the user to missing items
fmt = "\t%s\t%s\n" fmt = "\t%s\t%s\n"
items = [fmt % (dep.full_name(),dep.homepage) for dep in needed] items = [fmt % (dep.full_name(), dep.homepage) for dep in needed]
items.insert(0,"Please install the following packages *first*:\n") items.insert(0,"Please install the following packages *first*:\n")
items.append('') items.append('')
raise SystemExit('\n'.join(items)) # dump msg to stderr and exit raise SystemExit('\n'.join(items)) # dump msg to stderr and exit
def warn_unsafe_options_used(self): def warn_unsafe_options_used(self):
lines = []; write = lines.append lines = []; write = lines.append
write("the following command options are not supported for building") write("the following command options are not supported for building")
write("dependencies, and will be IGNORED:") write("dependencies, and will be IGNORED:")
for cmd,line in self.unsafe_options.items(): for cmd,line in self.unsafe_options.items():
write('\t%s %s' % (cmd,' '.join(line))) write('\t%s %s' % (cmd, ' '.join(line)))
write('') write('')
self.warn('\n'.join(lines)) self.warn('\n'.join(lines))
def is_needed(self,dep): def is_needed(self,dep):
"""Does the specified dependency need to be installed/updated?""" """Does the specified dependency need to be installed/updated?"""
self.announce("searching for "+dep.full_name()) self.announce("searching for "+dep.full_name())
version = dep.get_version(self.search_path) version = dep.get_version(self.search_path)
...@@ -152,13 +147,3 @@ class depends(Command): ...@@ -152,13 +147,3 @@ class depends(Command):
else: else:
self.announce(status+" (update needed)") self.announce(status+" (update needed)")
return True return True
"""Tests for the 'setuptools' package""" """Tests for the 'setuptools' package"""
from unittest import TestSuite, TestCase, makeSuite import os.path
import sys
from unittest import TestSuite, TestCase, makeSuite, main
import distutils.core, distutils.cmd import distutils.core, distutils.cmd
from distutils.core import Extension
from distutils.errors import DistutilsOptionError, DistutilsPlatformError from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError from distutils.errors import DistutilsSetupError
from distutils.util import convert_path
from distutils.version import StrictVersion, LooseVersion
import setuptools, setuptools.dist import setuptools, setuptools.dist
from setuptools import Feature from setuptools import Feature
from distutils.core import Extension
from setuptools.depends import extract_constant, get_module_constant from setuptools.depends import extract_constant, get_module_constant
from setuptools.depends import find_module, Require from setuptools.depends import find_module, Require
from distutils.version import StrictVersion, LooseVersion
from distutils.util import convert_path
import sys, os.path
def makeSetup(**args): def makeSetup(**args):
...@@ -20,7 +25,7 @@ def makeSetup(**args): ...@@ -20,7 +25,7 @@ def makeSetup(**args):
distutils.core._setup_stop_after = "commandline" distutils.core._setup_stop_after = "commandline"
# Don't let system command line leak into tests! # Don't let system command line leak into tests!
args.setdefault('script_args',['install']) args.setdefault('script_args', ['install'])
try: try:
return setuptools.setup(**args) return setuptools.setup(**args)
...@@ -28,21 +33,9 @@ def makeSetup(**args): ...@@ -28,21 +33,9 @@ def makeSetup(**args):
distutils.core_setup_stop_after = None distutils.core_setup_stop_after = None
class DependsTests(TestCase): class DependsTests(TestCase):
def testExtractConst(self): def testExtractConst(self):
from setuptools.depends import extract_constant from setuptools.depends import extract_constant
def f1(): def f1():
...@@ -70,18 +63,14 @@ class DependsTests(TestCase): ...@@ -70,18 +63,14 @@ class DependsTests(TestCase):
def testModuleExtract(self): def testModuleExtract(self):
from distutils import __version__ from distutils import __version__
self.assertEqual( self.assertEqual(get_module_constant('distutils', '__version__'),
get_module_constant('distutils','__version__'), __version__ __version__)
) self.assertEqual(get_module_constant('sys', 'version'),
self.assertEqual( sys.version)
get_module_constant('sys','version'), sys.version self.assertEqual(get_module_constant('setuptools.tests', '__doc__'),
) __doc__)
self.assertEqual(
get_module_constant('setuptools.tests','__doc__'),__doc__
)
def testRequire(self): def testRequire(self):
req = Require('Distutils','1.0.3','distutils') req = Require('Distutils','1.0.3','distutils')
self.assertEqual(req.name, 'Distutils') self.assertEqual(req.name, 'Distutils')
...@@ -99,7 +88,8 @@ class DependsTests(TestCase): ...@@ -99,7 +88,8 @@ class DependsTests(TestCase):
self.failUnless(req.is_present()) self.failUnless(req.is_present())
self.failUnless(req.is_current()) self.failUnless(req.is_current())
req = Require('Distutils 3000','03000','distutils',format=LooseVersion) req = Require('Distutils 3000', '03000', 'distutils',
format=LooseVersion)
self.failUnless(req.is_present()) self.failUnless(req.is_present())
self.failIf(req.is_current()) self.failIf(req.is_current())
self.failIf(req.version_ok('unknown')) self.failIf(req.version_ok('unknown'))
...@@ -119,47 +109,26 @@ class DependsTests(TestCase): ...@@ -119,47 +109,26 @@ class DependsTests(TestCase):
self.failUnless(req.is_present(paths)) self.failUnless(req.is_present(paths))
self.failUnless(req.is_current(paths)) self.failUnless(req.is_current(paths))
def testDependsCmd(self): def testDependsCmd(self):
path1 = convert_path('foo/bar/baz') path1 = convert_path('foo/bar/baz')
path2 = convert_path('foo/bar/baz/spam') path2 = convert_path('foo/bar/baz/spam')
dist = makeSetup( dist = makeSetup(extra_path='spam',
extra_path='spam', script_args=['install', '--install-lib', path1,
script_args=[ '--prefix', path2,
'install','--install-lib',path1, '--prefix',path2, 'build', '--compiler=mingw32',])
'build','--compiler=mingw32',
]
)
cmd = dist.get_command_obj('depends') cmd = dist.get_command_obj('depends')
cmd.ensure_finalized() cmd.ensure_finalized()
self.assertEqual(cmd.temp, dist.get_command_obj('build').build_temp) self.assertEqual(cmd.temp, dist.get_command_obj('build').build_temp)
self.assertEqual(cmd.search_path, [path2,path1]+sys.path) self.assertEqual(cmd.search_path, [path2,path1] + sys.path)
self.assertEqual(cmd.unsafe_options, self.assertEqual(cmd.unsafe_options,
{'install':['--install-lib',path1]} {'install': ['--install-lib',path1]})
)
self.assertEqual(cmd.safe_options, { self.assertEqual(cmd.safe_options, {
'build':['--compiler','mingw32'], 'build':['--compiler','mingw32'],
'install':['--prefix',os.path.abspath(path2)] 'install':['--prefix',os.path.abspath(path2)]})
})
class DistroTests(TestCase): class DistroTests(TestCase):
...@@ -179,10 +148,8 @@ class DistroTests(TestCase): ...@@ -179,10 +148,8 @@ class DistroTests(TestCase):
package_dir = {}, package_dir = {},
) )
def testDistroType(self): def testDistroType(self):
self.failUnless(isinstance(self.dist,setuptools.dist.Distribution)) self.failUnless(isinstance(self.dist, setuptools.dist.Distribution))
def testExcludePackage(self): def testExcludePackage(self):
self.dist.exclude_package('a') self.dist.exclude_package('a')
...@@ -201,8 +168,6 @@ class DistroTests(TestCase): ...@@ -201,8 +168,6 @@ class DistroTests(TestCase):
# test removals from unspecified options # test removals from unspecified options
makeSetup().exclude_package('x') makeSetup().exclude_package('x')
def testIncludeExclude(self): def testIncludeExclude(self):
# remove an extension # remove an extension
self.dist.exclude(ext_modules=[self.e1]) self.dist.exclude(ext_modules=[self.e1])
...@@ -241,48 +206,32 @@ class DistroTests(TestCase): ...@@ -241,48 +206,32 @@ class DistroTests(TestCase):
self.dist.exclude_package('c') self.dist.exclude_package('c')
self.failIf(self.dist.has_contents_for('c')) self.failIf(self.dist.has_contents_for('c'))
def testInvalidIncludeExclude(self): def testInvalidIncludeExclude(self):
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.include, nonexistent_option='x' self.dist.include, nonexistent_option='x')
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.exclude, nonexistent_option='x' self.dist.exclude, nonexistent_option='x')
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.include, packages={'x':'y'} self.dist.include, packages={'x':'y'})
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.exclude, packages={'x':'y'} self.dist.exclude, packages={'x':'y'})
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.include, ext_modules={'x':'y'} self.dist.include, ext_modules={'x':'y'})
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.exclude, ext_modules={'x':'y'} self.dist.exclude, ext_modules={'x':'y'})
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.include, package_dir=['q'] self.dist.include, package_dir=['q'])
)
self.assertRaises(DistutilsSetupError, self.assertRaises(DistutilsSetupError,
self.dist.exclude, package_dir=['q'] self.dist.exclude, package_dir=['q'])
)
def testCmdLineOpts(self): def testCmdLineOpts(self):
self.assertEqual(self.dist.get_cmdline_options(), self.assertEqual(
{ 'install':{'prefix':'/usr/lib', 'install-lib':'/test'}, self.dist.get_cmdline_options(),
'build': {'quiet':None}, 'build_ext':{'inplace':None}, {'install':{'prefix':'/usr/lib', 'install-lib':'/test'},
} 'build': {'quiet':None},
) 'build_ext': {'inplace':None},
})
class FeatureTests(TestCase): class FeatureTests(TestCase):
...@@ -295,51 +244,41 @@ class FeatureTests(TestCase): ...@@ -295,51 +244,41 @@ class FeatureTests(TestCase):
'bar': Feature("bar", standard=True, packages=['pkg.bar'], 'bar': Feature("bar", standard=True, packages=['pkg.bar'],
py_modules=['bar_et'], remove=['bar.ext'], py_modules=['bar_et'], remove=['bar.ext'],
), ),
'baz': Feature( 'baz': Feature("baz", optional=False, packages=['pkg.baz'],
"baz", optional=False, packages=['pkg.baz'], scripts=['scripts/baz_it'],
scripts = ['scripts/baz_it'], libraries=[('libfoo','foo/foofoo.c')]
libraries=[('libfoo','foo/foofoo.c')]
), ),
'dwim': Feature("DWIM", available=False, remove='bazish'), 'dwim': Feature("DWIM", available=False, remove='bazish'),
}, },
script_args=['--without-bar', 'install'], script_args=['--without-bar', 'install'],
packages = ['pkg.bar', 'pkg.foo'], packages=['pkg.bar', 'pkg.foo'],
py_modules = ['bar_et', 'bazish'], py_modules=['bar_et', 'bazish'],
ext_modules = [Extension('bar.ext',['bar.c'])] ext_modules=[Extension('bar.ext',['bar.c'])]
) )
def testDefaults(self): def testDefaults(self):
self.failIf( self.failIf(
Feature( Feature("test",standard=True,remove='x',available=False
"test",standard=True,remove='x',available=False ).include_by_default())
).include_by_default()
)
self.failUnless( self.failUnless(
Feature("test",standard=True,remove='x').include_by_default() Feature("test",standard=True,remove='x').include_by_default())
)
# Feature must have either kwargs, removes, or requires # Feature must have either kwargs, removes, or requires
self.assertRaises(DistutilsSetupError, Feature, "test") self.assertRaises(DistutilsSetupError, Feature, "test")
def testAvailability(self): def testAvailability(self):
self.assertRaises( self.assertRaises(DistutilsPlatformError,
DistutilsPlatformError, self.dist.features['dwim'].include_in, self.dist)
self.dist.features['dwim'].include_in, self.dist
)
def testFeatureOptions(self): def testFeatureOptions(self):
dist = self.dist dist = self.dist
self.failUnless( self.failUnless(('with-dwim', None, 'include DWIM')
('with-dwim',None,'include DWIM') in dist.feature_options in dist.feature_options)
) self.failUnless(('without-dwim', None, 'exclude DWIM (default)')
self.failUnless( in dist.feature_options)
('without-dwim',None,'exclude DWIM (default)') in dist.feature_options self.failUnless(('with-bar', None, 'include bar (default)')
) in dist.feature_options)
self.failUnless( self.failUnless(('without-bar', None, 'exclude bar')
('with-bar',None,'include bar (default)') in dist.feature_options in dist.feature_options)
)
self.failUnless(
('without-bar',None,'exclude bar') in dist.feature_options
)
self.assertEqual(dist.feature_negopt['without-foo'],'with-foo') self.assertEqual(dist.feature_negopt['without-foo'],'with-foo')
self.assertEqual(dist.feature_negopt['without-bar'],'with-bar') self.assertEqual(dist.feature_negopt['without-bar'],'with-bar')
self.assertEqual(dist.feature_negopt['without-dwim'],'with-dwim') self.assertEqual(dist.feature_negopt['without-dwim'],'with-dwim')
...@@ -363,9 +302,9 @@ class FeatureTests(TestCase): ...@@ -363,9 +302,9 @@ class FeatureTests(TestCase):
self.assertRaises(DistutilsOptionError, dist.include_feature, 'bar') self.assertRaises(DistutilsOptionError, dist.include_feature, 'bar')
def testFeatureWithInvalidRemove(self): def testFeatureWithInvalidRemove(self):
self.assertRaises( self.assertRaises(SystemExit,
SystemExit, makeSetup, features = {'x':Feature('x', remove='y')} makeSetup, features={'x': Feature('x', remove='y')})
)
class TestCommandTests(TestCase): class TestCommandTests(TestCase):
...@@ -388,7 +327,7 @@ class TestCommandTests(TestCase): ...@@ -388,7 +327,7 @@ class TestCommandTests(TestCase):
ts3 = makeSetup( ts3 = makeSetup(
test_suite='bar.tests', test_suite='bar.tests',
script_args=['test','-m','foo.tests'] script_args=['test','-m','foo.tests']
).get_command_obj('test') ).get_command_obj('test')
ts3.ensure_finalized() ts3.ensure_finalized()
self.assertEqual(ts3.test_module, 'foo.tests') self.assertEqual(ts3.test_module, 'foo.tests')
self.assertEqual(ts3.test_suite, 'foo.tests.test_suite') self.assertEqual(ts3.test_suite, 'foo.tests.test_suite')
...@@ -396,7 +335,7 @@ class TestCommandTests(TestCase): ...@@ -396,7 +335,7 @@ class TestCommandTests(TestCase):
def testConflictingOptions(self): def testConflictingOptions(self):
ts4 = makeSetup( ts4 = makeSetup(
script_args=['test','-m','bar.tests', '-s','foo.tests.suite'] script_args=['test','-m','bar.tests', '-s','foo.tests.suite']
).get_command_obj('test') ).get_command_obj('test')
self.assertRaises(DistutilsOptionError, ts4.ensure_finalized) self.assertRaises(DistutilsOptionError, ts4.ensure_finalized)
def testNoSuite(self): def testNoSuite(self):
...@@ -405,47 +344,13 @@ class TestCommandTests(TestCase): ...@@ -405,47 +344,13 @@ class TestCommandTests(TestCase):
self.assertEqual(ts5.test_suite, None) self.assertEqual(ts5.test_suite, None)
testClasses = (DependsTests, DistroTests, FeatureTests, TestCommandTests) testClasses = (DependsTests, DistroTests, FeatureTests, TestCommandTests)
def test_suite(): def test_suite():
return TestSuite([makeSuite(t,'test') for t in testClasses]) return TestSuite([makeSuite(t,'test') for t in testClasses])
if __name__ == "__main__":
# We have to run this from an imported setuptools.tests package,
# since the tests themselves rely on __path__.
import setuptools.tests
main(defaultTest="setuptools.tests.test_suite")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment