[Baypiggies] How to determine what unit tests cover a code change?

Nick Stinemates nstinemates at gmail.com
Thu Feb 3 04:08:17 CET 2011

How are dependencies being managed? Are you using mocks?  Fixtures?

Even for thousands of tests, it feels like it's taking way too long. As a
counterpoint, our software has tens of thousands of tests and we can build
the entire solution in less than an hour.


On Wed, Feb 2, 2011 at 11:18 AM, Lincoln Peters <anfrind at gmail.com> wrote:

> I work on a project with thousands of unit tests, implemented using
> the built-in "unittest" module, and it takes about five hours to run
> the full suite.  If I know which source files changed since I last ran
> the unit tests, does anyone know of a good way to determine which unit
> tests cover those source files and only run those?
> The individual test cases are spread across about 150 subclasses of
> TestCase, some of which define dozens of test methods, and for the
> most part each class is in its own module (there are a few cases where
> two subclasses of TestCase are in the same module, e.g. if one derives
> from the other and changes something about how the tests run).  My
> best idea thus far is to use the "inspect" module to look at what each
> test module imports and figure out if a changed file gets imported at
> any point.  But I wouldn't be at all surprised if there's an existing
> tool that does that, or if there's a better way that I haven't thought
> of.
> Thanks.
> --
> Lincoln Peters
> <anfrind at gmail.com>
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20110202/1f699b78/attachment.html>

More information about the Baypiggies mailing list