On 30 August 2016 at 23:02, Pete Vander Giessen <
pete.vandergies...@canonical.com> wrote:

The problems with the harness: patching sys.modules leads to a catch-22: if
> we don't leave the mocks in place, we still get import errors when using
> the mock library's mock.patch method, but if we do leave them in place,
> tests that set properties on them can end up interfering with each other.
> There are workarounds, but they're not intuitive, and they don't generate
> friendly error messages when they fail. We felt it best to leave the
> harness behind, and provide some advice on more straightforward things that
> you can do to work around the import errors. Thus the PR referenced above.
>

The tearDown method could reset the mock easily enough. I didn't need to do
that in the simple case I had (a single layer), but it should solve the
test isolation issue you have.



-- 
Stuart Bishop <stuart.bis...@canonical.com>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to