jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] tests: Assert number of deprecations
......................................................................
[IMPROV] tests: Assert number of deprecations
To allow only the expected deprecation also assert how many deprecations have
been issued.
Change-Id: Ib12d6f757cf843b4b19dc0584138dab11c97c42c
---
M tests/aspects.py
M tests/exceptions_tests.py
M tests/logentry_tests.py
M tests/site_tests.py
M tests/tools_ip_tests.py
5 files changed, 17 insertions(+), 16 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index a0209c8..0ab8a13 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -1363,12 +1363,15 @@
if self._do_test_warning_filename:
self.assertDeprecationFile(self.expect_warning_filename)
- def assertOneDeprecation(self, msg=None, reset=True):
- """Assert that exactly one deprecation happened and reset if wished."""
- self.assertEqual(len(self.deprecation_messages), 1)
+ def assertOneDeprecation(self, msg=None, count=1):
+ """Assert that exactly one deprecation message happened and reset."""
self.assertDeprecation(msg)
- if reset:
- self._reset_messages()
+ # This is doing such a weird structure, so that it shows any other
+ # deprecation message from the set.
+ self.assertCountEqual(set(self.deprecation_messages),
+ [self.deprecation_messages[0]])
+ self.assertEqual(len(self.deprecation_messages), count)
+ self._reset_messages()
def assertNoDeprecation(self, msg=None):
"""Assert that no deprecation warning happened."""
diff --git a/tests/exceptions_tests.py b/tests/exceptions_tests.py
index 9fa8041..eed0a08 100644
--- a/tests/exceptions_tests.py
+++ b/tests/exceptions_tests.py
@@ -47,11 +47,9 @@
def test_PageNotFound(self):
"""Test PageNotFound is deprecated from the package."""
cls = pywikibot.PageNotFound
- self.assertDeprecation(
+ self.assertOneDeprecation(
'pywikibot.PageNotFound is deprecated, and no longer '
'used by pywikibot; use http.fetch() instead.')
-
- self._reset_messages()
e = cls('foo')
self.assertIsInstance(e, pywikibot.Error)
@@ -62,11 +60,9 @@
cls = pywikibot.exceptions.PageNotFound
- self.assertDeprecation(
+ self.assertOneDeprecation(
'pywikibot.exceptions.PageNotFound is deprecated, and no longer '
'used by pywikibot; use http.fetch() instead.')
-
- self._reset_messages()
e = cls('foo')
self.assertIsInstance(e, pywikibot.Error)
diff --git a/tests/logentry_tests.py b/tests/logentry_tests.py
index 0678510..e81a173 100644
--- a/tests/logentry_tests.py
+++ b/tests/logentry_tests.py
@@ -236,9 +236,10 @@
if 'title' in logentry.data: # title may be missing
self.assertIsInstance(logentry.title(), pywikibot.Page)
self.assertIs(logentry.title(), logentry.page())
+ self.assertOneDeprecation(count=2)
else:
self.assertRaises(KeyError, logentry.title)
- self.assertDeprecation()
+ self.assertOneDeprecation()
self._reset_messages()
def test_getMovedTarget(self, key):
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 89bc964..f8705bc 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -78,12 +78,12 @@
self.assertIsInstance(ver, tuple)
self.assertTrue(all(isinstance(ver[i], int) for i in (0, 1)))
self.assertIsInstance(ver[2], basestring)
- self.assertDeprecation()
+ self.assertOneDeprecation()
def test_getcurrenttime(self):
"""Test live_version."""
self.assertEqual(self.site.getcurrenttime(), self.site.server_time())
- self.assertDeprecation()
+ self.assertOneDeprecation()
def test_siteinfo_normal_call(self):
"""Test calling the Siteinfo without setting dump."""
@@ -115,13 +115,13 @@
"""Test that filterredir set to 'only' is deprecated to True."""
for page in self.site.allpages(filterredir='only', total=1):
self.assertTrue(page.isRedirectPage())
- self.assertDeprecation()
+ self.assertOneDeprecation()
def test_allpages_filterredir_False(self):
"""Test that if filterredir's bool is False it's deprecated to False."""
for page in self.site.allpages(filterredir='', total=1):
self.assertFalse(page.isRedirectPage())
- self.assertDeprecation()
+ self.assertOneDeprecation()
def test_ns_index(self):
"""Test ns_index."""
diff --git a/tests/tools_ip_tests.py b/tests/tools_ip_tests.py
index 80cd776..6e9c46f 100644
--- a/tests/tools_ip_tests.py
+++ b/tests/tools_ip_tests.py
@@ -652,6 +652,7 @@
self.assertEqual(self.fail, 0)
self.assertDeprecation(
'page.ip_regexp is deprecated, use tools.ip.is_IP instead.')
+ self.assertEqual(self.total, len(self.deprecation_messages))
class IPAddressModuleTestCase(TestIPBase):
--
To view, visit https://gerrit.wikimedia.org/r/228576
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib12d6f757cf843b4b19dc0584138dab11c97c42c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2599
Status: Passed
Duration: 26 minutes and 6 seconds
Commit: a9327c1 (master)
Author: Merlijn van Deen
Message: i18n: always follow master
We want to keep i18n up to date for all branches, so we should
make the i18n branch always follow master. This is consistent
with SVN's behavior. If the format of messages changes (e.g.
from %s to %(name)s), a /new/ key should be added, as otherwise
translations might break for older branches.
Change-Id: I5b26cda3f740f9421d70834bbfdfed53a6985933
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/f4af0de4daa7...a9327c19…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/73685223
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: i18n: always follow master
......................................................................
i18n: always follow master
We want to keep i18n up to date for all branches, so we should
make the i18n branch always follow master. This is consistent
with SVN's behavior. If the format of messages changes (e.g.
from %s to %(name)s), a /new/ key should be added, as otherwise
translations might break for older branches.
Change-Id: I5b26cda3f740f9421d70834bbfdfed53a6985933
---
M .gitmodules
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.gitmodules b/.gitmodules
index 8400953..8e9744b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,7 +1,7 @@
[submodule "i18n"]
path = scripts/i18n
url = https://gerrit.wikimedia.org/r/p/pywikibot/i18n.git
- branch = .
+ branch = master
ignore = all
[submodule "externals/httplib2"]
--
To view, visit https://gerrit.wikimedia.org/r/228469
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b26cda3f740f9421d70834bbfdfed53a6985933
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: i18n: always follow master
......................................................................
i18n: always follow master
We want to keep i18n up to date for all branches, so we should
make the i18n branch always follow master. This is consistent
with SVN's behavior. If the format of messages changes (e.g.
from %s to %(name)s), a /new/ key should be added, as otherwise
translations might break for older branches.
Change-Id: I5b26cda3f740f9421d70834bbfdfed53a6985933
---
M .gitmodules
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.gitmodules b/.gitmodules
index b89493f..2c87632 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,5 +1,5 @@
[submodule "i18n"]
path = scripts/i18n
url = https://gerrit.wikimedia.org/r/p/pywikibot/i18n.git
- branch = .
+ branch = master
ignore = all
--
To view, visit https://gerrit.wikimedia.org/r/228468
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b26cda3f740f9421d70834bbfdfed53a6985933
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] ignore .svn folder and its subdirectories
......................................................................
[FIX] ignore .svn folder and its subdirectories
Change-Id: I5d2332cc3ea6b5f1f96fa56ecbd61fdb8e3ebc67
---
M maintenance/i18n_from_json.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/maintenance/i18n_from_json.py b/maintenance/i18n_from_json.py
index a4891a6..1008e1c 100644
--- a/maintenance/i18n_from_json.py
+++ b/maintenance/i18n_from_json.py
@@ -70,8 +70,9 @@
if self.source is None:
self.confirm = False
source = os.path.join('..', 'i18n')
- for root, dirs, files in os.walk(source):
- for d in dirs:
+ root, dirs, files = next(os.walk(source))
+ for d in dirs:
+ if not d.startswith('.'):
self.treat(d)
else:
self.treat(self.source)
--
To view, visit https://gerrit.wikimedia.org/r/228448
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5d2332cc3ea6b5f1f96fa56ecbd61fdb8e3ebc67
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2598
Status: Passed
Duration: 32 minutes and 48 seconds
Commit: f4af0de (master)
Author: Merlijn van Deen
Message: Updated pywikibot/core
Project: pywikibot/i18n 156fc510bfbcdb7563b13155e2b354eae80e27cf
Remove .py translation files
We have JSON now. Thanks, Amir!
This reverts commit 28a4a9cfeba97206333e46d75b79f8b4aa4a26d9.
compat has i18n_from_json maintenance script which can be used to
create the needed message files. i18n.twtranslate already warns the
user to use that script when the translation package is not available.
Signed-off-by: xqt <info(a)gno.de>
Change-Id: Ie832cebf87ede2db925867e7bffbcf7fdb6e4538
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/1db58dbb763f...f4af0de4…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/73661285
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Remove .py translation files
......................................................................
Remove .py translation files
We have JSON now. Thanks, Amir!
This reverts commit 28a4a9cfeba97206333e46d75b79f8b4aa4a26d9.
compat has i18n_from_json maintenance script which can be used to
create the needed message files. i18n.twtranslate already warns the
user to use that script when the translation package is not available.
Signed-off-by: xqt <info(a)gno.de>
Change-Id: Ie832cebf87ede2db925867e7bffbcf7fdb6e4538
---
D .pep8
M __init__.py
D add_text.py
D archivebot.py
D basic.py
D blockpageschecker.py
D capitalize_redirects.py
D casechecker.py
D catall.py
D category.py
D category_redirect.py
D clean_sandbox.py
D commons.py
D commons_link.py
D commonscat.py
D cosmetic_changes.py
D delete.py
D djvutext.py
D editarticle.py
D featured.py
D fixing_redirects.py
D followlive.py
D interwiki.py
D isbn.py
D lonelypages.py
D makecat.py
D misspelling.py
D movepages.py
D ndashredir.py
D noreferences.py
D pagefromfile.py
D piper.py
D protect.py
D pywikibot.py
D redirect.py
D reflinks.py
D remove_edp_images.py
D replace.py
D revertbot.py
D selflink.py
D solve_disambiguation.py
D spamremove.py
D spellcheck.py
D table2wiki.py
D template.py
D thirdparty.py
D undelete.py
D unlink.py
D unprotect.py
D weblinkchecker.py
D welcome.py
51 files changed, 4 insertions(+), 27,452 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
--
To view, visit https://gerrit.wikimedia.org/r/226493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie832cebf87ede2db925867e7bffbcf7fdb6e4538
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>