nose-devs/nose — Issue #72: use abstract syntax trees to discover tests instead of importing modules
Author: jpellerin
Created: 2011-12-14 15:58:02+00:00
State: open

Several default configurations of frameworks that support nose (confirmed
for Pylons, maybe Django too?) are not fully import safe and thus need
custom directory configurations for nose to run an app's test suite
correctly. See this thread for further discussion:
http://groups.google.com/group/nose-dev/browse_thread/thread/fec291197853385f

The problem can be avoided if the discovery of nose test objects is done
with abstract syntax trees (AST) instead of importing and introspecting.

As for an implementation, the stdlib module "compiler" provides AST hooks:
http://python.org/doc/2.2.3/lib/compiler.html ... and the pydoctor source
code has an example of something similar using compiler:
http://codespeak.net/svn/user/mwh/pydoctor/trunk/pydoctor/astbuilder.py

One approach could be to try building this as a plugin for a proof of
concept, however it would benefit most as a core feature, IMHO.

If I get some time I'll start a work branch for this and put a comment
here. If anyone else has time to get this started sooner, by all means,
hack away and just post a comment here for where the work branch is.

Google Code Info:
Issue #: 116
Author: kumar.mcmillan
Created On: 2007-10-16T19:42:25.000Z
Closed On: