Merge lp://qastaging/~free.ekanayaka/python-fixtures/reusable-fixture into lp://qastaging/~python-fixtures/python-fixtures/trunk

Proposed by Free Ekanayaka
Status: Needs review
Proposed branch: lp://qastaging/~free.ekanayaka/python-fixtures/reusable-fixture
Merge into: lp://qastaging/~python-fixtures/python-fixtures/trunk
Diff against target: 155 lines (+110/-0)
4 files modified
lib/fixtures/__init__.py (+2/-0)
lib/fixtures/_fixtures/__init__.py (+2/-0)
lib/fixtures/_fixtures/reusable.py (+45/-0)
lib/fixtures/tests/_fixtures/test_reusable.py (+61/-0)
To merge this branch: bzr merge lp://qastaging/~free.ekanayaka/python-fixtures/reusable-fixture
Reviewer Review Type Date Requested Status
python-fixtures committers Pending
Review via email: mp+171503@code.qastaging.launchpad.net

Description of the change

This an idea that came out from this MP:

https://code.launchpad.net/~free.ekanayaka/rabbitfixture/non-ephemeral/+merge/171117

you might want to read it for the full background.

In a nutshell: in case an expensive fixture can be re-used across different tests, projects can wrap it with ReusableFixture and have it setup/cleaned-up only once.

I've tried to understand if this could be done somehow with testresources (perhaps with the reset() method), but I couldn't figure that out. Comments are welcome.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Hi, this is interesting.

So, testresources is aimed at this, grab me on IRC and I can debug
what's not working for you. If you're seeing setup/teardowns, you
don't have the optimiser working properly.

That said, we can do this thing you've got here, and I'll give it a
full review this week.

-Rob

Unmerged revisions

68. By Free Ekanayaka

Add ReusableFixture

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches