Opened 18 years ago
Closed 18 years ago
#4025 closed enhancement (invalid)
[PATCH] Add dynamic test loading
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | test suite setuptools |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Currently each test module imports all it's test suites explicitly in the __init__.py
file. This means that every time you add a new test case to a suite (one of the modules under a *.tests
package) or add a new test suite to a package (i.e. a new module to a *.tests
package), you need to update another file. This manual updating is a bit of a pain; instead, I propose a dynamic test detection routine that picks up individual tests from modules, test suites from suite()
functions and doctests from modules that have them.
The first patch modifies trac.test.suite()
to crawl directories in the source tree and dynamically pick up tests. This causes breakage in certain modules which the second patch begins to address by cleaning out some unused suite-building structures.
Please note that this "solution" is incomplete: I would like to know if this direction is interesting to the TracTeam. If so, I will polish these patches and make sure that everything is tight and that all tests are running properly.
The attached patches are against the setuptools
branch in the sandbox.
Attachments (2)
Change History (4)
by , 18 years ago
Attachment: | svn_patch_against_r4044_sandbox_setuptools.patch added |
---|
by , 18 years ago
Attachment: | svn_patch_against_r4044_sandbox_setuptools_cleaning.patch added |
---|
This patch cleans some of the test suites to remove unused boilerplate code
comment:1 by , 18 years ago
Have you checked how this interferes with peak:setuptools#test? In particular, it seems that the scanning facility is built-in (see peak:setuptools#test-loader).
comment:2 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
You're right, it is. Sorry for the confusion.
This patch adds the test detection routine to
trac.tests