jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743593 )
Change subject: [doc] Update ROADMAP.rst
......................................................................
[doc] Update ROADMAP.rst
Change-Id: If178cba54114b7b05d756ec60f5879c6ff9c9cec
---
M ROADMAP.rst
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 620fe29..7c9aa2f 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -4,6 +4,10 @@
Improvements and Bugfixes
-------------------------
+* Add support for Python 3.11
+* Use page.site.data_repository when creating a _WbDataPage (T296985)
+* Fix mysql AttributeError for sock.close() on toolforge (T216741)
+* Pywikibot supports PyPy 3 (T101592)
* Enable move generate_user_files.py with site-package (T107629)
* Only search user_script_paths inside config.base_dir (T296204)
* pywikibot.argv has been fixed for pwb.py wrapper if called with global args (T254435)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743593
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: If178cba54114b7b05d756ec60f5879c6ff9c9cec
Gerrit-Change-Number: 743593
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743567 )
Change subject: [tests] always use TestTimerMixin with TestCaseBase
......................................................................
[tests] always use TestTimerMixin with TestCaseBase
A lot of tests does not notify the test time used but there are a lot
of tests which are time consuming like wikisource:zh tests and pypy
tests. Use the TestTimerMixin for all tests to get more information
about time usage.
Bug: T186323
Change-Id: I06996f8e4a75a38933e331581cd38a64d4aee28c
---
M tests/aspects.py
1 file changed, 25 insertions(+), 27 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index 3d1ac61..ef26423 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -65,7 +65,30 @@
pywikibot.bot.set_interface('buffer')
-class TestCaseBase(unittest.TestCase):
+class TestTimerMixin(unittest.TestCase):
+
+ """Time each test and report excessive durations."""
+
+ # Number of seconds each test may consume
+ # before a note is added after the test.
+ test_duration_warning_interval = 10
+
+ def setUp(self):
+ """Set up test."""
+ self.test_start = time.time()
+ super().setUp()
+
+ def tearDown(self):
+ """Tear down test."""
+ super().tearDown()
+ self.test_completed = time.time()
+ duration = self.test_completed - self.test_start
+ if duration > self.test_duration_warning_interval:
+ unittest_print(' {0:.3f}s'.format(duration), end=' ')
+ sys.stdout.flush()
+
+
+class TestCaseBase(TestTimerMixin):
"""Base class for all tests."""
@@ -268,31 +291,6 @@
code, info, msg, self).handle(callable_obj, args, kwargs)
-class TestTimerMixin(TestCaseBase):
-
- """Time each test and report excessive durations."""
-
- # Number of seconds each test may consume
- # before a note is added after the test.
- test_duration_warning_interval = 10
-
- def setUp(self):
- """Set up test."""
- super().setUp()
- self.test_start = time.time()
-
- def tearDown(self):
- """Tear down test."""
- self.test_completed = time.time()
- duration = self.test_completed - self.test_start
-
- if duration > self.test_duration_warning_interval:
- unittest_print(' {0:.3f}s'.format(duration), end=' ')
- sys.stdout.flush()
-
- super().tearDown()
-
-
def require_modules(*required_modules):
"""Require that the given list of modules can be imported."""
def test_requirement(obj):
@@ -835,7 +833,7 @@
dct[test_name].__doc__ = doc
-class TestCase(TestTimerMixin, TestCaseBase, metaclass=MetaTestCaseClass):
+class TestCase(TestCaseBase, metaclass=MetaTestCaseClass):
"""Run tests on pre-defined sites."""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743567
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I06996f8e4a75a38933e331581cd38a64d4aee28c
Gerrit-Change-Number: 743567
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743368 )
Change subject: [IMPR] Use min buildin instead of value comparison
......................................................................
[IMPR] Use min buildin instead of value comparison
Change-Id: Ibeafad4def6af42b5374600740c93f1ca083a086
---
M scripts/checkimages.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 08cac8a..645b25e 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1293,8 +1293,8 @@
if skip_number == 0:
pywikibot.output('\t\t>> No files to skip...<<')
return False
- if skip_number > limit:
- skip_number = limit
+
+ skip_number = min(skip_number, limit)
# Print a starting message only if no images has been skipped
if not self.skip_list:
pywikibot.output(
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743368
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ibeafad4def6af42b5374600740c93f1ca083a086
Gerrit-Change-Number: 743368
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743564 )
Change subject: [tests] Show a more informative message with failing test
......................................................................
[tests] Show a more informative message with failing test
TestTerminalOutput.test_exception_tb fails for Python 3.11.
Show additional information about the reason.
Bug: T297044
Change-Id: I924498656d0e419d6548d7e44e32690d7bce0f37
---
M tests/ui_tests.py
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/ui_tests.py b/tests/ui_tests.py
index 2718610..fc7c75f 100644
--- a/tests/ui_tests.py
+++ b/tests/ui_tests.py
@@ -212,7 +212,11 @@
self.assertEqual(stderrlines[1], 'Traceback (most recent call last):')
self.assertEqual(stderrlines[3],
" raise TestExceptionError('Testing Exception')")
- self.assertTrue(stderrlines[4].endswith(': Testing Exception'))
+ end_str = ': Testing Exception'
+ traceback_line = stderrlines[4]
+ self.assertTrue(traceback_line.endswith(end_str),
+ '\n{!r} does not end with {!r}'
+ .format(traceback_line, end_str))
self.assertNotEqual(stderrlines[-1], '\n')
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743564
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I924498656d0e419d6548d7e44e32690d7bce0f37
Gerrit-Change-Number: 743564
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743355 )
Change subject: [bugfix] use page.site.data_repository when creating a _WbDataPage
......................................................................
[bugfix] use page.site.data_repository when creating a _WbDataPage
use page.site.data_repository() instead of default Site().data_repository()
when creating a _WbDataPage.
Bug: T296985
Change-Id: I4784d6e7b5de03102c2c7524ace687d3789ad3d3
---
M pywikibot/__init__.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Matěj Suchánek: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index f0f678e..53e4c7f 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -943,7 +943,7 @@
:param page: page containing the data
:param site: The Wikibase site
"""
- site = site or Site().data_repository()
+ site = site or page.site.data_repository()
specifics = type(self)._get_type_specifics(site)
_WbDataPage._validate(page, specifics['data_site'],
specifics['ending'], specifics['label'])
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743355
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4784d6e7b5de03102c2c7524ace687d3789ad3d3
Gerrit-Change-Number: 743355
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Lokal Profil <andre.costa(a)wikimedia.se>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged