Merge lp:~pwlars/lava-test/fixtures into lp:lava-test/0.0

Proposed by Paul Larson
Status: Merged
Merged at revision: 26
Proposed branch: lp:~pwlars/lava-test/fixtures
Merge into: lp:lava-test/0.0
Diff against target: 0 lines
To merge this branch: bzr merge lp:~pwlars/lava-test/fixtures
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+34270@code.launchpad.net

Description of the change

James, I took a look at your recommendation for adding support for fixtures. See if this is something along the lines of what you were thinking.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

Hi,

Looks good, thanks.

I would call them "FakeOutput" and "FakeConfig" or similar, as they aren't
really Tests anymore. I would also rename the module to "fixtures" or "testing".

87 + def cleanup(self):
88 + for fixture in self._fixtures:
89 + fixture.tearDown()
90 + self._fixtures = []

Why not make that the tearDown method, to save subclasses having to do
it explicitly?

111 class ListInstalled(FakeConfigTests):

I don't think that's what you want any more is it?

138 + def setUp(self):

You should upcall from the setUp and tearDown whenever you implement
them, to save hitting weird issues if the hierarchy changes.

Thanks,

James

review: Approve
lp:~pwlars/lava-test/fixtures updated
27. By Paul Larson

Fixups from code review:
 * Change Fake* names
 * change cleanup() to tearDown for fixtures so that it doesn't need to
   be explicitly called

Preview Diff

Empty

Subscribers

People subscribed via source and target branches