jenkins-bot submitted this change.

View Change

Approvals: Matěj Suchánek: Looks good to me, but someone else must approve JJMC89: Looks good to me, approved jenkins-bot: Verified
[IMPR] a wait time may be given with -simulate option

This is a more realistic simulation because it simulates a delay for
each write action.

Change-Id: I3fa4b5f430e8d59a5648eb89cb6042b752f1d809
M pywikibot/
M pywikibot/data/
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pywikibot/ b/pywikibot/
index 1dc7855..ca6af38 100644
--- a/pywikibot/
+++ b/pywikibot/
@@ -210,6 +210,8 @@
-simulate Disables writing to the server. Useful for testing and
debugging of new code (if given, doesn't do any real
changes, but only shows what would have been changed).
+ An integer or float value may be given to simulate a
+ processing time; the bot just waits for given seconds.

-<config var>:n You may use all given numeric config variables as option and
modify it with command line.
@@ -839,7 +841,7 @@
output('NOTE: option cosmetic_changes is %s\n'
% config.cosmetic_changes)
elif option == '-simulate':
- config.simulate = True
+ config.simulate = value or True
# DEBUG control:
diff --git a/pywikibot/data/ b/pywikibot/data/
index 8a80457..28b64e4 100644
--- a/pywikibot/data/
+++ b/pywikibot/data/
@@ -1592,6 +1592,9 @@
'{lightyellow}SIMULATION: {0} action blocked.{default}',
+ # for more realistic simulation
+ if config.simulate is not True:
+ pywikibot.sleep(float(config.simulate))
return {action: {'result': 'Success', 'nochange': ''}}

def _is_wikibase_error_retryable(self, error):

To view, visit change 607072. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3fa4b5f430e8d59a5648eb89cb6042b752f1d809
Gerrit-Change-Number: 607072
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <>
Gerrit-Reviewer: Dvorapa <>
Gerrit-Reviewer: JJMC89 <>
Gerrit-Reviewer: Matěj Suchánek <>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged