Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609583
)
Change subject: [tests] replace os.system usage in ui_tests.py
......................................................................
[tests] replace os.system usage in ui_tests.py
As suggested replace os.system by subprocess.run; see
https://docs.python.org/3.5/library/subprocess.html#replacing-os-system
Change-Id: Idb2f48423e0bd664b1d0618141950f186a5925cd
---
M tests/ui_tests.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Zhuyifei1999: Looks good to me, approved
diff --git a/tests/ui_tests.py b/tests/ui_tests.py
index 6337eaa..3920567 100644
--- a/tests/ui_tests.py
+++ b/tests/ui_tests.py
@@ -129,7 +129,7 @@
setattr(pywikibot.ui, key, value)
def cls(self):
- os.system('cls')
+ subprocess.run('cls', shell=True)
class pywikibotManager(BaseManager):
@@ -683,7 +683,9 @@
def testOutputUnicodeText_no_transliterate(self):
self.sendstdin(
- "python -c \"import os, pywikibot; os.system('cls');
"
+ 'python -c \"'
+ 'import subprocess, pywikibot; '
+ "subprocess.run('cls', shell=True); "
"pywikibot.output('\\n'.join(pywikibot.handleArgs()))\"
"
'Alpha Bετα Гамма دلتا\n')
lines = []
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/609583
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: Idb2f48423e0bd664b1d0618141950f186a5925cd
Gerrit-Change-Number: 609583
Gerrit-PatchSet: 6
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged