|
From: | Carlos García |
Subject: | Re: [Fab-user] Isolating env for unittests? |
Date: | Fri, 10 Mar 2017 10:24:09 +0100 |
Hi Chris,
I think the cleanest way is to use the context manager settings()
From the docs:
from fabric.api import settings, run
def exists(path):
with settings(warn_only=True):
return run('test -e %s' % path)
Regards
2017-03-10 3:37 GMT+01:00 Chris Spencer <address@hidden>:
but I still get weird errors caused by left-over env keys from other tests.env.update(tmp)env.clear()...run testWhat's the best way to save and restore env?I'm trying to unittest some custom Fabric tasks, and I'm having a real problem not-polluting the global env variable. I've tried things like:
tmp = env.copy()
_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user
[Prev in Thread] | Current Thread | [Next in Thread] |