Add context manager to ease using mox right

Bug #1680481 reported by Martin Häcker on 2017-04-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Hi there,

using mox3 right would be much easier if it had a context manager like this:

    def mox(test_class):
        mox = Mox()
        yield mox


To be used like this in unit test:

def test_something(self):
    with mox(self) as mox:
        mox.StubOutWithMock(FormEditor, 'revert_to_initial_values')
    # test code that uses the mocked objects

Can you please add that to the library? (Naming is of course something you would have to decide on).

Martin Häcker (spamfaenger) wrote :

ping @maintainers: any word on this?

Martin Häcker (spamfaenger) wrote :

ping @maintainers: anybody here? Is this project still alive?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers