jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/831530 )
Change subject: [tests] Move djvulibre library test from setUpClass to setUpModule. ......................................................................
[tests] Move djvulibre library test from setUpClass to setUpModule.
Change-Id: If34cdc5ba465dc87c73866debf93b66c5045f75a --- M tests/djvu_tests.py 1 file changed, 9 insertions(+), 10 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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()