{"issue":{"created_at":"2011-12-14T16:05:22Z","state":"closed","updated_at":"2011-12-14T16:05:24Z","user":{"gravatar_id":"86e49052bd9a5fb3eabfd7368b68bbb7","id":34519,"url":"https://api.github.com/users/jpellerin","login":"jpellerin","avatar_url":"https://secure.gravatar.com/avatar/86e49052bd9a5fb3eabfd7368b68bbb7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":2,"body":"With nose 0.10.0, if I use multiple with_setup() decorators, only the first \"wins\".\n\nIf I say:\n@with_setup(s1, t1)\n@with_setup(s2, t2)\ndef test_me():\n    pass\n\nThe resulting call sequence is:\ns1(), test_me(), s2().\n\nThe sequence should be:\ns1(), s2(), test_me(), t2(), t1().\n\nThis can be easily fixed by implementing with_setup() using the make_decorator() already \npresent in nose.tools (the same way limit was implemented):\n\ndef with_setup(setup=None, teardown=None):\n    \"\"\"Decorator to add setup and/or teardown methods to a test function::\n\n      @with_setup(setup, teardown)\n      def test_something():\n          # ...\n\n    Note that `with_setup` is useful *only* for test functions, not for test\n    methods or inside of TestCase subclasses.\n    \"\"\"\n    def decorate(func, setup=setup, teardown=teardown):\n        def newfunc(*arg, **kw):\n            if setup:\n                setup()\n            try:\n                func(*arg, **kw)\n            finally:\n                if teardown:\n                    teardown()\n        newfunc = make_decorator(func)(newfunc)\n        return newfunc\n    return decorate\n\n\n\nGoogle Code Info:\nIssue #: 151\nAuthor: tles...@gmail.com\nCreated On: 2008-01-18T19:18:48.000Z\nClosed On: 2008-03-28T02:29:12.000Z","assignee":{"gravatar_id":"86e49052bd9a5fb3eabfd7368b68bbb7","id":34519,"url":"https://api.github.com/users/jpellerin","login":"jpellerin","avatar_url":"https://secure.gravatar.com/avatar/86e49052bd9a5fb3eabfd7368b68bbb7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2553614,"labels":[],"number":251,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Multiple with_setup() decorators do not work","html_url":"https://github.com/nose-devs/nose/issues/251","closed_at":"2011-12-14T16:05:23Z","url":"https://api.github.com/repos/nose-devs/nose/issues/251","milestone":null},"action":"created","comment":{"created_at":"2011-12-14T16:05:23Z","updated_at":"2011-12-14T16:05:23Z","user":{"gravatar_id":"86e49052bd9a5fb3eabfd7368b68bbb7","id":34519,"url":"https://api.github.com/users/jpellerin","login":"jpellerin","avatar_url":"https://secure.gravatar.com/avatar/86e49052bd9a5fb3eabfd7368b68bbb7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"\n\nGoogle Code Info:\nAuthor: jpelle...@gmail.com\nCreated On: 2008-01-21T21:44:59.000Z","id":3142462,"url":"https://api.github.com/repos/nose-devs/nose/issues/comments/3142462"}}