jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] oauth and user flag of OAuthEditTest ......................................................................
[IMPROV] oauth and user flag of OAuthEditTest
Change-Id: Ie7a86131bc08839d14bd80f0126bd9c394fbfeb4 --- M tests/aspects.py M tests/edit_tests.py M tests/oauth_tests.py 3 files changed, 9 insertions(+), 2 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved XZise: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py index 994a3de..4c09d1c 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -593,6 +593,9 @@ for site in cls.sites.values(): cls.require_site_user(site['family'], site['code'], sysop)
+ if hasattr(cls, 'oauth') and cls.oauth: + continue + try: site['site'].login(sysop) except NoUsername: @@ -620,6 +623,9 @@ # logged in. for site in self.sites.values(): site = site['site'] + + if hasattr(self, 'oauth') and self.oauth: + continue
if not site.logged_in(sysop): site.login(sysop) @@ -783,7 +789,7 @@ bases = tuple([CheckHostnameMixin] + list(bases))
if 'write' in dct and dct['write']: - if 'user' not in dct and 'oauth' not in dct: + if 'user' not in dct: dct['user'] = True bases = tuple([SiteWriteMixin] + list(bases))
diff --git a/tests/edit_tests.py b/tests/edit_tests.py index 0e9ce7e..5ea3db9 100644 --- a/tests/edit_tests.py +++ b/tests/edit_tests.py @@ -82,7 +82,6 @@ code = 'test'
write = True - oauth = True
def setUp(self): """Set up test by checking site and initialization.""" diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py index 8a7955e..a0210de 100644 --- a/tests/oauth_tests.py +++ b/tests/oauth_tests.py @@ -28,6 +28,8 @@
"""Run tests related to OAuth authentication."""
+ oauth = True + @classmethod def setUpClass(cls): """Check if mwoauth is installed."""
pywikibot-commits@lists.wikimedia.org