Danek Duvall wrote: > On Sun, Oct 05, 2008 at 04:14:44PM -0500, Shawn Walker wrote: > >> For giggles and grins, > > (The shits having been taken care of by the usual preferred authority?) > >> what about a test that actually also does an unset-authority on the >> second authority? > > You can't remove the preferred authority, so there's no way to get there. > > Or do you mean, remove auth1 after I've switched the primary authority to > auth2?
Yes, sorry. > I tried that -- it was my initial test -- but it screwed up all the tests > that were run after it. I was under the impression that setUp() was run > before each test, rather than once per class, but the behavior I saw > indicated that it was being run once, so when I unset the authority, later > tests failed because of it. Thankfully, the tests run successfully with > test2 as the primary authority. > > Does that seem weird to anyone? I could, I suppose write a new class for > this test, or reset all the authority stuff at the end of this function, if > the behavior I'm seeing is the right one. No, that's the expected behaviour currently. If you'll note lines 34-35 of t_twodepot.py, you'll see that it has set persistent_depot = true. That means that setUp() and tearDown() won't be run before and after each test. Likewise, tests are run in lexical order based on name, so if you want to control the order tests are run in, you'll have to change all the names of the tests to sort in the order you want, such as: def test_0_foo: ... def test_1_baz: ... deftest_2_bar: ... This is all corroborated by line 68 of pkg5unittest.py and by the unittest pydoc page. Cheers, -- Shawn Walker _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
