Re: [py-dev] Using funcargs with decorators

2012-10-15 Thread Antonio Cuni
On 10/12/2012 06:50 PM, Floris Bruynooghe wrote: Are these being addressed by PEP 362? I must admit I haven't had time to read this yet, but if functools.wraps gets updated it was my understanding that the *args, **kwargs inspection issue should be solved and if you can set attributes on the

Re: [py-dev] Using funcargs with decorators

2012-10-12 Thread Antonio Cuni
On 10/11/2012 11:53 PM, holger krekel wrote: On a sidenote, i am not sure Python's decorator design was such a great idea. Maybe it should have been restricted to setting attributes (like C# and also java IIRC) and then a way to get those attributed functions on a per-class, per-module or

Re: [py-dev] Using funcargs with decorators

2012-10-11 Thread holger krekel
Hi Sebastian, On Thu, Oct 11, 2012 at 11:47 +0200, Sebastian Rahlf wrote: Hi! At work we use a decorator @rollback on selected test functions which will rollback any db changes made during that test. I've recently started using pytest's dependency injection for a few use cases, both with

Re: [py-dev] Using funcargs with decorators

2012-10-11 Thread Sebastian Rahlf
Hi Holger! At work we use a decorator @rollback on selected test functions which will rollback any db changes made during that test. I've recently started using pytest's dependency injection for a few use cases, both with @pytest.mark.parametrize(...) and the pytest_funcarg__XXX hook.

Re: [py-dev] Using funcargs with decorators

2012-10-11 Thread holger krekel
Hi Sebastian, On Thu, Oct 11, 2012 at 14:44 +0200, Sebastian Rahlf wrote: Hi Holger! At work we use a decorator @rollback on selected test functions which will rollback any db changes made during that test. I've recently started using pytest's dependency injection for a few use

Re: [py-dev] Using funcargs with decorators

2012-10-11 Thread holger krekel
Hi Anto, On Thu, Oct 11, 2012 at 22:10 +0200, Antonio Cuni wrote: Hi Holger, Sebastian, On 10/11/2012 03:16 PM, holger krekel wrote: ah, now i get it. You want to assign the function back. That is indeed not going to work as pytest then sees the rollback function (i assume you return