jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[tests] Move djvulibre library test from setUpClass to setUpModule.

Change-Id: If34cdc5ba465dc87c73866debf93b66c5045f75a
---
M tests/djvu_tests.py
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/tests/djvu_tests.py b/tests/djvu_tests.py
index 6a6e004..1d3ed95 100755
--- a/tests/djvu_tests.py
+++ b/tests/djvu_tests.py
@@ -31,16 +31,6 @@
file_djvu_wo_text = join_djvu_data_path('myfile_wo_text.djvu')
test_txt = 'A file with non-ASCII characters, \nlike é or ç'

- @classmethod
- def setUpClass(cls):
- """Setup tests."""
- super().setUpClass()
- with skipping(OSError, msg='djvulibre library not installed.'):
- dp = subprocess.Popen(['djvudump'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- dp.communicate()
-
def test_repr_method(self):
"""Test __repr__() method."""
djvu = DjVuFile(self.file_djvu)
@@ -125,6 +115,15 @@
self.assertTrue(djvu.has_text(force=True))


+def setUpModule():
+ """Sekip if djvulibre library not installed."""
+ with skipping(OSError, msg='djvulibre library not installed.'):
+ dp = subprocess.Popen(['djvudump'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ dp.communicate()
+
+
if __name__ == '__main__': # pragma: no cover
with suppress(SystemExit):
unittest.main()

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: If34cdc5ba465dc87c73866debf93b66c5045f75a
Gerrit-Change-Number: 831530
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged