Decorators

nose2 ships with various decorators that assist you to write your tests.

Setup & Teardown

nose2.tools.decorators.with_setup(setup)[source]

A decorator that sets the setup() method to be executed before the test.

It currently works only for function test cases.

Parameters:setup (function) – The method to be executed before the test.
nose2.tools.decorators.with_teardown(teardown)[source]

A decorator that sets the teardown() method to be after before the test.

It currently works only for function test cases.

Parameters:teardown (function) – The method to be executed after the test.