On Wed, Jul 30, 2008 at 05:19:28PM -0700, Brad Hall wrote:

> Link to CR: http://cr.opensolaris.org/~bhall/bug-2690/

Damned shame that class decorators aren't available until Python 2.6 --
this would be the perfect use for them.

Alternatively, you could use function decorators to decorate individual
tests that required a fresh depot.  That could be extended at some point in
the future to have a decorator for tests that required (or didn't require)
a fresh image, too.

Or maybe all you need is a method that a test can call to re-initialize all
its depots?

Perhaps you considered these designs, I dunno.  But if you did, please
explain why you decided against them.

> I added a variable to the classes to denote whether this should be
> enabled for a given class or not named 'static'.  I couldn't think of a
> better name at the time so I'm open to suggestions if people think that's
> a bad name for this :)

I'll throw out "reuse_depot".  Just reading through the webrev, "static" is
already getting really confusing.

testutils.py:

  - line 552-558: I don't like leaving in commented-out code like this.
    Either yank it entirely, or enhance the else to check to see if the
    test is not "static".

pkg5unittest.py:

  - line 49: Please refrain from using single-line if statements like this

  - line 52-54: combine as
    
        static = getattr(self, "static", False)

  - line 57: Well, we do need to call it for the first one.  You might add
    to the comment saying that's done down in the testsuite class below.
    And capitalize setUp() properly (on 228, too).

  - line 83: space before colon

  - line 216-218: use extended getattr() call as above.

  - line 220: no need for parens around lvalue

  - line 221, 236: do these need to be in try blocks as they are in
    Pkg5TestCase.run()?

Thanks,
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to