Reputation: 147
I use nosetests and allure framework for reporting purposes. In order to make the report look like I want, I have to add @nose.allure.feature('some feature')
decorator to each test. The problem is that I have over 1000 test. Is there any way to modify tests before execution?
I was thinking about custom nose plugin, but not sure how can it be implemented.
Upvotes: 0
Views: 332
Reputation: 714
A plug-in is definitely the way to go. there is a bunch of documentation on creating plug-ins:
http://nose.readthedocs.io/en/latest/doc_tests/test_issue119/empty_plugin.html http://nose.readthedocs.io/en/latest/search.html?q=+plugin
I think you'll probably want to extend the test runner. You can look at what that decorator is doing before and after calling the function, and then just add that stuff in the test runner.
Upvotes: 1
Reputation: 12409
How about adding the decorator to the test classes instead?
Not sure if it will work, but sometimes works nicely for @patch
.
Upvotes: 0