jenkins-bot has submitted this change and it was merged.
Change subject: remove obsolete pywikibot.stopme() at the end of these scripts. ......................................................................
remove obsolete pywikibot.stopme() at the end of these scripts.
In core branch pywikibot.stopme() is called by atexit library. The function is executed upon normal program termination. This patch prohibits executing it twice.
Change-Id: I360593a84694877e48ecc76efe163e436b8c1093 --- M tests/date_tests.py M tests/page_tests.py M tests/site_tests.py M tests/timestripper_tests.py M tests/ui_tests.py M tests/wikibase_tests.py 6 files changed, 22 insertions(+), 37 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/date_tests.py b/tests/date_tests.py index 32477ba..5b69bc2 100644 --- a/tests/date_tests.py +++ b/tests/date_tests.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# (C) Pywikipedia bot team, 2014 +# (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # @@ -40,9 +40,6 @@
if __name__ == '__main__': try: - try: - unittest.main() - except SystemExit: - pass - finally: - pywikibot.stopme() + unittest.main() + except SystemExit: + pass diff --git a/tests/page_tests.py b/tests/page_tests.py index d764f68..c6984a7 100644 --- a/tests/page_tests.py +++ b/tests/page_tests.py @@ -3,7 +3,7 @@ Tests for the page module. """ # -# (C) Pywikipedia bot team, 2008 +# (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # @@ -325,9 +325,6 @@
if __name__ == '__main__': try: - try: - unittest.main() - except SystemExit: - pass - finally: - pywikibot.stopme() + unittest.main() + except SystemExit: + pass diff --git a/tests/site_tests.py b/tests/site_tests.py index 79db3e2..f219522 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -3,7 +3,7 @@ Tests for the site module. """ # -# (C) Pywikipedia bot team, 2008 +# (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # @@ -1160,9 +1160,6 @@
if __name__ == '__main__': try: - try: - unittest.main() - except SystemExit: - pass - finally: - pywikibot.stopme() + unittest.main() + except SystemExit: + pass diff --git a/tests/timestripper_tests.py b/tests/timestripper_tests.py index fd2ea1d..f828b47 100644 --- a/tests/timestripper_tests.py +++ b/tests/timestripper_tests.py @@ -3,7 +3,7 @@ Tests for archivebot.py/Timestripper. """ # -# (C) Pywikipedia bot team, 2014 +# (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # @@ -64,9 +64,6 @@
if __name__ == '__main__': try: - try: - unittest.main() - except SystemExit: - pass - finally: - pywikibot.stopme() + unittest.main() + except SystemExit: + pass diff --git a/tests/ui_tests.py b/tests/ui_tests.py index b737e33..ad92448 100644 --- a/tests/ui_tests.py +++ b/tests/ui_tests.py @@ -3,7 +3,7 @@ Tests for the page module. """ # -# (C) Pywikipedia bot team, 2008 +# (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # @@ -488,7 +488,6 @@ pass finally: unpatch() - pywikibot.stopme()
else: class TestTerminalUI(unittest.TestCase): diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index 43116fa..14a5020 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -3,11 +3,12 @@ Tests for the Wikidata parts of the page module. """ # -# (C) Pywikipedia bot team, 2008-2013 +# (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' +#
import os import pywikibot @@ -81,9 +82,6 @@
if __name__ == '__main__': try: - try: - unittest.main() - except SystemExit: - pass - finally: - pywikibot.stopme() + unittest.main() + except SystemExit: + pass
pywikibot-commits@lists.wikimedia.org