From fb76e7210334ecbadcabfb1549e9df40c138b746 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Tue, 28 Mar 2006 22:40:57 +0000 Subject: Enhanced test loader to scan packages as well as modules, and call ``additional_tests()`` if present to get non-unittest tests. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043412 --- setuptools/tests/__init__.py | 53 +++++--------------------------------------- 1 file changed, 6 insertions(+), 47 deletions(-) (limited to 'setuptools/tests/__init__.py') diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py index 7009b321..ea469446 100644 --- a/setuptools/tests/__init__.py +++ b/setuptools/tests/__init__.py @@ -13,6 +13,12 @@ from distutils.version import StrictVersion, LooseVersion from distutils.util import convert_path import sys, os.path +def additional_tests(): + import doctest + return doctest.DocFileSuite( + 'api_tests.txt', optionflags=doctest.ELLIPSIS, package='pkg_resources', + ) + def makeSetup(**args): """Return distribution from 'setup(**args)', without executing commands""" @@ -33,12 +39,6 @@ def makeSetup(**args): - - - - - - class DependsTests(TestCase): def testExtractConst(self): @@ -362,47 +362,6 @@ class TestCommandTests(TestCase): ts5 = makeSetup().get_command_obj('test') ts5.ensure_finalized() self.assertEqual(ts5.test_suite, None) - - - - - -def test_api(): - import doctest - return doctest.DocFileSuite( - 'api_tests.txt', optionflags=doctest.ELLIPSIS, package='pkg_resources', - ) - - -testClasses = (DependsTests, DistroTests, FeatureTests, TestCommandTests) -testNames = ["setuptools.tests.test_resources", "setuptools.tests.test_api"] - -def test_suite(): - return TestSuite( - [makeSuite(t,'test') for t in testClasses]+ - [defaultTestLoader.loadTestsFromName(n) for n in testNames] - ) - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3