Knowing which test method is about to run in setup()

11 views
Skip to first unread message

Michael Elsdörfer

unread,
Apr 16, 2012, 8:37:41 AM4/16/12
to nose...@googlegroups.com
I occasionally find I need/want this. I expect to make setup() take an argument and receive the test method that will be run, but it never works. Is that something that could sensibly be added?

As an example: I am testing a part of the server. setup() brings the server into a particular state. A test method needs a particular configuration variable set. Setting that variable when the test method runs is too late. I put a @with_setup(foo=bar) decorator on the test method, the setup() can read the information the decorator set, voilà.
Reply all
Reply to author
Forward
0 new messages