Page MenuHomePhabricator

GCI: Document unit test decorators
Closed, ResolvedPublic

Description

There are a few custom decorators available for the pywikibot test suite.

$ git grep -h '^\w*@[^:]*' tests | cut -d '(' -f 1 | sort -u
@add_full_name
@add_metaclass
@deprecate_arg
@deprecated
@deprecated_args
@echo off
@mock.patch
@noop
@patch
@remove_last_args
@require_modules
@unittest.skipIf
@unittest.skipUnless

They should be documented in tests/README.rst .

Details

Related Changes in Gerrit:

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript

Does this task need more detail?

You can chat with me in Phabricator, https://gitter.im/jayvdb , IRC (jayvdb) or email.

@jayvdb No, I've got stuff IRL so I abandoned it at the GCI side (which constantly sends me deadline emails), so that I can take my time. Definitely still working on it.

Change 326245 had a related patch set uploaded (by Dargasia):
Document test decorators.

https://gerrit.wikimedia.org/r/326245

Change 326245 had a related patch set uploaded (by Dargasia):

PS 1 includes mock.patch, tests.aspects.require_modules, unittest.skipIf and unittest.skipUnless. These are decorators actually provided by testing-related packages.
The rest are from pwb itself or defined within tests. I did not consider them to be part of the test suite.

Change 326245 merged by jenkins-bot:
Document test decorators.

https://gerrit.wikimedia.org/r/326245