jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/740899 )
Change subject: [tests] Only find one alternative script with script_tests.py
......................................................................
[tests] Only find one alternative script with script_tests.py
Also uncomment code parts from previous debugging
and update tox.ini
Bug: T296204
Change-Id: I90d92434b47e0890cc61720c55d7f0205ab166ae
---
M tests/script_tests.py
M tox.ini
2 files changed, 28 insertions(+), 17 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py
index b1e3968..cb88909 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -10,11 +10,14 @@
from contextlib import suppress
from pywikibot.tools import has_module
+from pywikibot import config
+
from tests import join_root_path, unittest_print
from tests.aspects import DefaultSiteTestCase, MetaTestCaseClass, PwbTestCase
from tests.utils import execute_pwb
+saved_pwb_close_matches = config.pwb_close_matches
scripts_path = join_root_path('scripts')
# These dependencies are not always the package name which is in setup.py.
@@ -54,9 +57,8 @@
return scripts
-##script_list = (['login']
-## + list_scripts(scripts_path, 'login.py'))
-script_list = ['login', 'add_text', 'archivebot', 'basic', 'blockpageschecker']
+script_list = (['login']
+ + list_scripts(scripts_path, 'login.py'))
script_input = {
'interwiki': 'Test page that should not exist\n',
@@ -150,17 +152,17 @@
test_list = ['tests.script_tests.TestScriptHelp.' + name
for name in tests]
-## tests = (['test__login']
-## + ['test_' + name
-## for name in sorted(script_list)
-## if name != 'login'
-## and name not in failed_dep_script_set
-## and name not in unrunnable_script_set
-## and (enable_autorun_tests or name not in auto_run_script_list)
-## ])
-##
-## test_list += ['tests.script_tests.TestScriptSimulate.' + name
-## for name in tests]
+ tests = (['test__login']
+ + ['test_' + name
+ for name in sorted(script_list)
+ if name != 'login'
+ and name not in failed_dep_script_set
+ and name not in unrunnable_script_set
+ and (enable_autorun_tests or name not in auto_run_script_list)
+ ])
+
+ test_list += ['tests.script_tests.TestScriptSimulate.' + name
+ for name in tests]
tests = loader.loadTestsFromNames(test_list)
suite = unittest.TestSuite()
@@ -193,7 +195,7 @@
'PYWIKIBOT_TEST_AUTORUN=1 to enable) "{}"'
.format(script_name))
- def testScript(self):
+ def test_script(self):
global_args = 'For global options use -help:global or run pwb'
cmd = [script_name] + args
@@ -279,7 +281,7 @@
if not enable_autorun_tests and is_autorun:
return test_skip_script
- return testScript
+ return test_script
arguments = dct['_arguments']
@@ -366,6 +368,16 @@
_results = no_args_expected_results
+def setUpModule(): # noqa: N802
+ """Only find one alternative script (T296204)."""
+ config.pwb_close_matches = 1
+
+
+def tearDownModule(): # noqa: N802
+ """Restore pwb_close_matches setting."""
+ config.pwb_close_matches = saved_pwb_close_matches
+
+
if __name__ == '__main__': # pragma: no cover
with suppress(SystemExit):
unittest.main()
diff --git a/tox.ini b/tox.ini
index d76165b..47069fb 100644
--- a/tox.ini
+++ b/tox.ini
@@ -211,7 +211,6 @@
tests/page_tests.py: E241, N802
tests/pagegenerators_tests.py: N802
tests/pwb/*: T001
- tests/script_tests.py: N802, E265, E266, E501
tests/site_detect_tests.py: N802
tests/site_tests.py: N802
tests/sparql_tests.py: N802
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/740899
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: I90d92434b47e0890cc61720c55d7f0205ab166ae
Gerrit-Change-Number: 740899
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/740644 )
Change subject: [tests] Temporary add commonscat to unrunnable_script_set
......................................................................
[tests] Temporary add commonscat to unrunnable_script_set
This patch is for debug purpose only
Bug: T296204
Change-Id: I193dc74434f5a2f622c642effa06f73695dfa741
---
M tests/script_tests.py
1 file changed, 12 insertions(+), 12 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/tests/script_tests.py b/tests/script_tests.py
index f746518..8c29872 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -42,7 +42,7 @@
if not check_script_deps(name)}
# scripts which cannot be tested
-unrunnable_script_set = set()
+unrunnable_script_set = {'commonscat'}
def list_scripts(path, exclude=None):
@@ -152,17 +152,17 @@
test_list = ['tests.script_tests.TestScriptHelp.' + name
for name in tests]
- tests = (['test__login']
- + ['test_' + name
- for name in sorted(script_list)
- if name != 'login'
- and name not in failed_dep_script_set
- and name not in unrunnable_script_set
- and (enable_autorun_tests or name not in auto_run_script_list)
- ])
-
- test_list += ['tests.script_tests.TestScriptSimulate.' + name
- for name in tests]
+## tests = (['test__login']
+## + ['test_' + name
+## for name in sorted(script_list)
+## if name != 'login'
+## and name not in failed_dep_script_set
+## and name not in unrunnable_script_set
+## and (enable_autorun_tests or name not in auto_run_script_list)
+## ])
+##
+## test_list += ['tests.script_tests.TestScriptSimulate.' + name
+## for name in tests]
tests = loader.loadTestsFromNames(test_list)
suite = unittest.TestSuite()
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/740644
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: I193dc74434f5a2f622c642effa06f73695dfa741
Gerrit-Change-Number: 740644
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/+/740340 )
Change subject: [bugfix] Don't call check_modules() as a site package
......................................................................
[bugfix] Don't call check_modules() as a site package
Change-Id: I6b09fd146f1a06d5b4c8b31b1a39bc100a1b7042
---
M pwb.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py
index 321def5..8c5da9f 100755
--- a/pwb.py
+++ b/pwb.py
@@ -439,7 +439,7 @@
help_option = any(arg.startswith('-help:') or arg == '-help'
for arg in script_args)
- if check_modules(filename) or help_option:
+ if site_package or check_modules(filename) or help_option:
run_python_file(filename,
[filename] + script_args,
[Path(filename).stem] + argvu[1:],
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/740340
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: I6b09fd146f1a06d5b4c8b31b1a39bc100a1b7042
Gerrit-Change-Number: 740340
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/+/740339 )
Change subject: [doc] Update ROADMAP.rst and CHANGELOG.md
......................................................................
[doc] Update ROADMAP.rst and CHANGELOG.md
Change-Id: Ib2eafbc075a21b573172b8091f73d39db20f0bf7
---
M ROADMAP.rst
M scripts/CHANGELOG.md
2 files changed, 6 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 93acb6c..9d32716 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -4,6 +4,9 @@
Improvements and Bugfixes
-------------------------
+* Make pwb wrapper script a pywikibot entry point for scripts (T139143, T270480)
+* Enable -version and --version with pwb wrapper or code entry point (T101828)
+* Retry upload if 'copyuploadbaddomain' API error occurs (T294825)
* Add `title_delimiter_and_aliases` attribute to family files to support WikiHow family (T294761)
* Only handle query limit if query module is limited (T294836)
* BaseBot has a public collections.Counter for reading, writing and skipping a page
@@ -29,6 +32,8 @@
Code cleanups
-------------
+* Raise a TypeError if BaseBot.init_page return None
+* Remove private upload parameters in UploadRobot.upload_file(), FilePage.upload() and APISite.upload() methods
* Raise an Error exception if 'titles' is still used as where parameter in Site.search()
* Deprecated version.get_module_version() function was removed
* Deprecated setOptions/getOptions OptionHandler methods were removed
diff --git a/scripts/CHANGELOG.md b/scripts/CHANGELOG.md
index b87f57f..b55e5c1 100644
--- a/scripts/CHANGELOG.md
+++ b/scripts/CHANGELOG.md
@@ -43,6 +43,7 @@
* Deprecated "acceptall" and "addedCat" parameters were replaced by "always" and "addcat"
### revertbot
+* Add support for translated dates/times (T102174)
* Deprecated "max" parameter was replaced by "total"
### solve_disambiguation
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/740339
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: Ib2eafbc075a21b573172b8091f73d39db20f0bf7
Gerrit-Change-Number: 740339
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged