On Wed, Aug 19, 2015 at 6:51 PM, Sylvain Bauza wrote:
> Hi,
>
> I was writing some tests so I added a contextlib.nested to a checked
> TestCase [1]. Unfortunately, contextlib.nested is no longer available in
> Python3 and there is no clear solution on how to provide a compatible
> import for both
On Tue, 25 Aug 2015 12:23:28 -0700
Jay Pipes wrote:
> On 08/25/2015 10:17 AM, Joshua Harlow wrote:
> > Oh, discard everything I say then :)
> >
> > My brain must still be partially functioning due to vacation,
> > haha.
>
> import functools
>
> def work(vacation=False):
> if not vacation
On 08/25/2015 10:17 AM, Joshua Harlow wrote:
Oh, discard everything I say then :)
My brain must still be partially functioning due to vacation, haha.
import functools
def work(vacation=False):
if not vacation:
get_lots_done()
back_from_vacation = functools.partial(work, vacation=
On Sun, 23 Aug 2015 18:32:33 -0400
Davanum Srinivas wrote:
> Josh,
>
> the test.nested() in Nova uses exactly that:
> http://git.openstack.org/cgit/openstack/nova/tree/nova/test.py#n75
>
> -- dims
Oh, discard everything I say then :)
My brain must still be partially functioning due to vacatio
Le 20/08/2015 03:37, John Garbutt a écrit :
On 20 August 2015 at 01:42, melanie witt wrote:
On Aug 19, 2015, at 16:51, Sylvain Bauza wrote:
Ideas appreciated.
Instead of using the nested context managers, a way I like is to decorate a
nested function in the test and call it, for example:
Le 23/08/2015 02:01, Feodor Tersin a écrit :
> From: kevin.mitch...@rackspace.com
>
> Actually, there should no longer be a need to use contextlib.nested.
> We've explicitly dropped Python 2.6 compatibility, which means we're
> expecting compatibility with Python 2.7+ only, and as of Python 2.7
Josh,
the test.nested() in Nova uses exactly that:
http://git.openstack.org/cgit/openstack/nova/tree/nova/test.py#n75
-- dims
On Sun, Aug 23, 2015 at 5:16 PM, Joshua Harlow wrote:
> On Fri, 21 Aug 2015 10:39:34 -0500
> "Kevin L. Mitchell" wrote:
>
> > On Wed, 2015-08-19 at 16:51 -0700, Sylvai
On Fri, 21 Aug 2015 10:39:34 -0500
"Kevin L. Mitchell" wrote:
> On Wed, 2015-08-19 at 16:51 -0700, Sylvain Bauza wrote:
> > I was writing some tests so I added a contextlib.nested to a
> > checked TestCase [1]. Unfortunately, contextlib.nested is no longer
> > available in Python3 and there is no
> From: kevin.mitch...@rackspace.com
>
> Actually, there should no longer be a need to use contextlib.nested.
> We've explicitly dropped Python 2.6 compatibility, which means we're
> expecting compatibility with Python 2.7+ only, and as of Python 2.7, the
> 'with' statement supports accepting mult
On Wed, 2015-08-19 at 16:51 -0700, Sylvain Bauza wrote:
> I was writing some tests so I added a contextlib.nested to a checked
> TestCase [1]. Unfortunately, contextlib.nested is no longer available in
> Python3 and there is no clear solution on how to provide a compatible
> import for both pyth
On 20 August 2015 at 01:42, melanie witt wrote:
> On Aug 19, 2015, at 16:51, Sylvain Bauza wrote:
>
>> Ideas appreciated.
>
> Instead of using the nested context managers, a way I like is to decorate a
> nested function in the test and call it, for example:
>
>
> def test_thing(self):
>
> @m
On Aug 19, 2015, at 16:51, Sylvain Bauza wrote:
> Ideas appreciated.
Instead of using the nested context managers, a way I like is to decorate a
nested function in the test and call it, for example:
def test_thing(self):
@mock.patch(...)
@mock.patch(...)
@mock.patch(...)
def
haha :)
-- dims
On Wed, Aug 19, 2015 at 7:59 PM, Sylvain Bauza wrote:
>
>
> Le 19/08/2015 16:51, Sylvain Bauza a écrit :
>
>> Hi,
>>
>> I was writing some tests so I added a contextlib.nested to a checked
>> TestCase [1]. Unfortunately, contextlib.nested is no longer available in
>> Python3 and
Le 19/08/2015 16:51, Sylvain Bauza a écrit :
Hi,
I was writing some tests so I added a contextlib.nested to a checked
TestCase [1]. Unfortunately, contextlib.nested is no longer available
in Python3 and there is no clear solution on how to provide a
compatible import for both python2 and py
Hi,
I was writing some tests so I added a contextlib.nested to a checked
TestCase [1]. Unfortunately, contextlib.nested is no longer available in
Python3 and there is no clear solution on how to provide a compatible
import for both python2 and python3:
- either providing a python3 compatible
15 matches
Mail list logo