blob: f75aa5e8a9da939ec13ee354e8f21e57cf447302 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
"""Test suite for distutils2.
This test suite consists of a collection of test modules in the
distutils2.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Utility code is included in distutils2.tests.support.
Always import unittest from this module: it will be unittest from the
standard library for packaging tests and unittest2 for distutils2 tests.
"""
import os
import sys
import unittest2 as unittest
def test_suite():
suite = unittest.TestSuite()
here = os.path.dirname(__file__) or os.curdir
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "distutils2.tests." + fn[:-3]
__import__(modname)
module = sys.modules[modname]
suite.addTest(module.test_suite())
return suite
|