Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#4025 closed enhancement (invalid)

[PATCH] Add dynamic test loading

Reported by: Iain Lowe <me@…> 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)

svn_patch_against_r4044_sandbox_setuptools.patch (3.3 KB ) - added by Iain Lowe <me@…> 17 years ago.
This patch adds the test detection routine to trac.tests
svn_patch_against_r4044_sandbox_setuptools_cleaning.patch (5.9 KB ) - added by Iain Lowe <me@…> 17 years ago.
This patch cleans some of the test suites to remove unused boilerplate code

Download all attachments as: .zip

Change History (4)

by Iain Lowe <me@…>, 17 years ago

This patch adds the test detection routine to trac.tests

by Iain Lowe <me@…>, 17 years ago

This patch cleans some of the test suites to remove unused boilerplate code

comment:1 by Christian Boos, 17 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 Iain Lowe <me@…>, 17 years ago

Resolution: invalid
Status: newclosed

You're right, it is. Sorry for the confusion.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.