Page MenuHomePhabricator

Tests: allow for logged-out operation
Closed, ResolvedPublic

Description

Currently, tests require the user to be logged in. It would be good to be able to run tests without requiring that -- for example, the unit tests in jenkins do not have a password available and thus cannot run completely.

Tests that should be skipped can be seen at https://integration.wikimedia.org/ci/job/pywikibot-core-tests/185/consoleFull


Version: core-(2.0)
Severity: normal

Details

Reference
bz56960

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:33 AM
bzimport set Reference to bz56960.
bzimport added a subscriber: Unknown Object (????).

pyfisch wrote:

It would also be great if fetching functions would work without logging in in General.

Change 154469 had a related patch set uploaded by John Vandenberg:
Test metaclass

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

This request was mostly completed in https://gerrit.wikimedia.org/r/#/c/151604/ .

https://gerrit.wikimedia.org/r/154469 provides all the functionality, and marks some tests as needing a 'user', but some are not yet marked as needing a 'user' as some test classes need to be split so the tests which need a user are separated from the other tests which can run without a user.

jayvdb claimed this task.

Specifying that tests require a valid user has been added, allowing only anon tests to be run using

nosetests -a '!user'