decorators don't play nice with nose?

2009-04-06 Thread hyperboreean
Hi, I am trying to test the business part of a web service. For this I am using unittest nose. I wrote a decorator that should handle the xml test file retrieval, but it seems I can't get it working with nose. Here's the code: * MyApp.py -- base test class * import os import unittest from

Re: decorators don't play nice with nose?

2009-04-06 Thread J Kenneth King
hyperboreean hyperbore...@nerdshack.com writes: From: hyperboreean hyperbore...@nerdshack.com Subject: decorators don't play nice with nose? Newsgroups: comp.lang.python To: python-list@python.org Date: Mon, 06 Apr 2009 11:01:04 +0300 Hi, I am trying to test the business part of a web

Re: decorators don't play nice with nose?

2009-04-06 Thread Diez B. Roggisch
hyperboreean schrieb: Hi, I am trying to test the business part of a web service. For this I am using unittest nose. I wrote a decorator that should handle the xml test file retrieval, but it seems I can't get it working with nose. Here's the code: * MyApp.py -- base test class * import os

Re: decorators don't play nice with nose?

2009-04-06 Thread Michele Simionato
On Apr 6, 11:11 pm, Diez B. Roggisch de...@nospam.web.de wrote: Nose works via the func_name parameter of a method/function. So when you decorate it, you need to make sure that is set properly. One option is to do something like this: from functools import wraps def my_decorator(f):