On Wed, Apr 22, 2009 at 12:52:29PM -0700, Istvan Albert wrote: -> On Apr 22, 3:29?pm, Christopher Lee <l...@chem.ucla.edu> wrote: -> > On Apr 22, 2009, at 12:22 PM, C. Titus Brown wrote: -> -> > Can we just use nose for this test skipping capability? ?i.e. unittest ? -> > would blindly run all the tests, but nose would automatically skip ? -> > tests excluded on a given platform? -> -> Or alternatively can we just accept as a known limitation that single -> test specification does not work with skipping flag?
That would give us two ways of running a test, with the possibility of screwing us up in the future... I already see that adding an empty 'runTest' function breaks the unittest assumptions but works with get_suite, which is a tad alarming -- what is get_suite doing differently!? Anyway, I've put up some examples of the various options: http://github.com/ctb/pygr/commit/5365a123d8359f2065fcffc4b43bbb6ab7fdb44d -- 1. Here's a pair of tests, neither one of which is skipped, resulting in an error: http://github.com/ctb/pygr/blob/5365a123d8359f2065fcffc4b43bbb6ab7fdb44d/trial/tests.py Verdict: obviously bad ;) -- 2. Here's the same pair, but with one skipped in the same way we're doing it now, by not returning it from get_suite(): http://github.com/ctb/pygr/blob/5365a123d8359f2065fcffc4b43bbb6ab7fdb44d/trial/tests-no-append.py This would not work with the single-test specification code, which would automatically discover both SimpleTest and SimpleSkipTest. Verdict: works, but not with single-test specification. -- 3. Here's the same pair, but with one skipped by not defining it: http://github.com/ctb/pygr/blob/5365a123d8359f2065fcffc4b43bbb6ab7fdb44d/trial/tests-skip-by-nodef.py This works with both get_suite and with the single-test code, because SimpleSkipTest tests simply aren't defined when they should't be run. Verdict: works, but is ugly (IMO). -- 4. Here's the same pair, but using nose.SkipTest to skip the test (if nose is available) and otherwise throwing an error with a custom error message. http://github.com/ctb/pygr/blob/5365a123d8359f2065fcffc4b43bbb6ab7fdb44d/trial/tests-skip.py Verdict: Works with nose, breaks with unittest; isn't too ugly. -- 5. Here's the same pair, but with a hack that implements test skipping. http://github.com/ctb/pygr/blob/1a57fa71a529bfb7dc90dee6dd17a918e1117471/trial/test-skip-hack.py Verdict: works; doesn't involve changing tests to be incompatible with unittest; could be added nicely to runtest; not too ugly. The stuff at the end would be used in runtest and nowhere else, and we could even retain nose compatibility. It also fits with some evil plans I have for tracking which tests SHOULD HAVE BEEN executed, which also requires modifications to our test runner -- see http://code.google.com/p/pygr/issues/detail?id=77. -- Comments? I propose #5 as the cleanest option. --titus -- C. Titus Brown, c...@msu.edu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to pygr-dev@googlegroups.com To unsubscribe from this group, send email to pygr-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en -~----------~----~----~----~------~----~------~--~---