jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/397531 )
Change subject: Add commit-message-validator to jenkins' envlist
......................................................................
Add commit-message-validator to jenkins' envlist
Also, use dashes instead of underscores for flake8-invalid-escape-sequences.
Apparently, it's more customary to write package names with dashes and that's
how setuptools treats them anyway.[1]
[1]: https://mail.python.org/pipermail/distutils-sig/2011-August/017936.html
Change-Id: I88d2f39fad7c6ef9a11f33b30e1be67f5dcdcafe
---
M tox.ini
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tox.ini b/tox.ini
index 422ac52..a59f7be 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,7 @@
# Override default for WM Jenkins
# Others are run in their own individual jobs on WM Jenkins
# Wikimedia Jenkins does not have Python 2.6
-envlist = flake8,pyflakes-{py3,pypy}
+envlist = commit-message,flake8,pyflakes-{py3,pypy}
[params]
doctest_skip = --ignore-files=(gui\.py|botirc\.py|eventstreams\.py)
@@ -69,7 +69,7 @@
flake8-print>=2.0.1
flake8-mock>=0.3
pep8-naming
- flake8_invalid_escape_sequences
+ flake8-invalid-escape-sequences
# 4a226d07 is https://github.com/erikrose/blessings/pull/104
[testenv:flake8-diff]
--
To view, visit https://gerrit.wikimedia.org/r/397531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I88d2f39fad7c6ef9a11f33b30e1be67f5dcdcafe
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/396576 )
Change subject: Replace assertRaises with assertRaisesRegex in category_tests.py
......................................................................
Replace assertRaises with assertRaisesRegex in category_tests.py
assertRaises is not as good of a test as asserRaisesRegex.
The latter has an extra parameter to match the exception message,
allowing more more precision when checking an error.
Bug: T154281
Change-Id: Ia941decd329640a4e043208b52e5ce581b2bf0c0
---
M tests/category_tests.py
1 file changed, 11 insertions(+), 4 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
MtDu: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/tests/category_tests.py b/tests/category_tests.py
index e4b4ba1..0d3f2d6 100644
--- a/tests/category_tests.py
+++ b/tests/category_tests.py
@@ -17,6 +17,9 @@
"""Test Category object."""
+ NOCATEGORYNAMESPACE_RE = '\'(.*?)\' is not in the category namespace!'
+ NOREDIRECTPAGE_RE = 'Page \[\[(.*?)\]\] is not a redirect page.'
+
family = 'wikipedia'
code = 'en'
@@ -25,7 +28,8 @@
def test_init(self):
"""Test the category's __init__ for one condition that can't be dry."""
site = self.get_site()
- self.assertRaises(ValueError, pywikibot.Category, site, 'Wikipedia:Test')
+ self.assertRaisesRegex(ValueError, self.NOCATEGORYNAMESPACE_RE,
+ pywikibot.Category, site, 'Wikipedia:Test')
def test_is_empty(self):
"""Test if category is empty or not."""
@@ -146,13 +150,15 @@
self.assertEqual(tgt, cat2)
# Raise exception if target is fetched for non Category redirects.
- self.assertRaises(pywikibot.IsNotRedirectPage,
- cat2.getCategoryRedirectTarget)
+ self.assertRaisesRegex(pywikibot.IsNotRedirectPage,
+ self.NOREDIRECTPAGE_RE, cat2.getCategoryRedirectTarget)
class TestCategoryDryObject(TestCase):
"""Test the category object with dry tests."""
+
+ NOCATEGORYNAMESPACE_RE = '\'(.*?)\' is not in the category namespace!'
family = 'wikipedia'
code = 'en'
@@ -178,7 +184,8 @@
self.assertTrue(cat_dup_ns.title(withNamespace=False), 'Page:Foo')
self.assertTrue(cat_dup_ns.namespace(), 14)
- self.assertRaises(ValueError, pywikibot.Category, site, 'Talk:Foo')
+ self.assertRaisesRegex(ValueError, self.NOCATEGORYNAMESPACE_RE,
+ pywikibot.Category, site, 'Talk:Foo')
def test_section(self):
"""Test the section method."""
--
To view, visit https://gerrit.wikimedia.org/r/396576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia941decd329640a4e043208b52e5ce581b2bf0c0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Divadsn <divad.nnamtdeis(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: MtDu <justin.d128(a)gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>