jenkins-bot has submitted this change and it was merged.

Change subject: plugin: use random name for tests
......................................................................


plugin: use random name for tests

Do not use a fixed name (Q_git) to test entity creation because it will
race when running multiple tests at once.

Change-Id: Idcc8cbcbb53203ba2defe601aac344f935c4d816
Signed-off-by: Loic Dachary <l...@dachary.org>
---
M tests/test_plugin.py
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Dachary: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/test_plugin.py b/tests/test_plugin.py
index 8fe185a..253e027 100644
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -49,11 +49,12 @@
             '--user=FLOSSbotCI',
         ])
         plugin = Plugin(bot, bot.args)
-        item = plugin.Q_git
+        name = 'Q_' + WikidataHelper.random_name()
+        item = plugin.__getattribute__(name)
         assert 1 == len(plugin.bot.entities['item'])
         plugin.clear_entity_label(item.getID())
         assert 0 == len(plugin.bot.entities['item'])
-        item = plugin.Q_git
+        item = plugin.__getattribute__(name)
         assert 1 == len(plugin.bot.entities['item'])
 
         property2datatype = {

-- 
To view, visit https://gerrit.wikimedia.org/r/316650
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idcc8cbcbb53203ba2defe601aac344f935c4d816
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/bots/FLOSSbot
Gerrit-Branch: master
Gerrit-Owner: Dachary <l...@dachary.org>
Gerrit-Reviewer: Dachary <l...@dachary.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to