[Zope3-dev] RFC: test.py --list-modules

Marius Gedminas mgedmin at b4net.lt
Fri Jan 12 16:30:15 EST 2007


The Zope 3 test runner can filter tests by package, module, test name and
layer.  Sometimes your expectations do not match reality and either the
test you want is not being run, or more tests than you wanted are being run.
When you want to debug filter patterns it helps if you can see what
tests would be run without wasting time actually running them.

I have implemented a --list-modules option in a branch.  It causes the
test runner to apply package and module name filters, and then print the
list of Python module names that would be imported.  It is very fast
because it doesn't actually import the modules.  It is not very accurate
because it does not pay attention to test name patterns or layer filtering.

Would this option be useful to anybody?

You can find the code here:

  http://svn.zope.org/zope.testing/branches/list-modules/?rev=71982&view=rev

I am also thinking about two other options:

  * --list-files -- essentially the same as --list-modules, but outputs
    file names instead of module names.

  * --list-tests -- apply package and module filters, import the
    modules, apply test name and layer filters, then list just the names
    of tests.

Would these be useful to anybody?

SchoolTool's custom test runner used to have --list-tests and
--list-files.  Now that SchoolTool has finally switched to the Zope 3
test runner, I wonder if anyone working on SchoolTool would miss those
(hi, Ignas ;-).

Marius Gedminas
-- 
   TCP_SeqNum - The 32-bit Sequence Number, encoded as an ASCII string
      representing the hex value of the Sequence number.  This field
      MUST be sent as lower case because it is not urgent.
                -- RFC 3093
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20070112/7d813549/attachment.bin


More information about the Zope3-dev mailing list