From 941526a8317884e4777d66d1000556b8df48151f Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 19 Feb 2017 11:30:16 +0200 Subject: [PATCH 1/2] Remove unrunnable code --- Tests/test_image_toqimage.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Tests/test_image_toqimage.py b/Tests/test_image_toqimage.py index 4a318c5c4..a4a03409a 100644 --- a/Tests/test_image_toqimage.py +++ b/Tests/test_image_toqimage.py @@ -14,8 +14,6 @@ if ImageQt.qt_is_installed: from PyQt4 import QtGui except (ImportError, RuntimeError): from PySide import QtGui - - class TestToQImage(PillowQtTestCase, PillowTestCase): @@ -32,7 +30,6 @@ class TestToQImage(PillowQtTestCase, PillowTestCase): tempfile = self.tempfile('temp_{}.png'.format(mode)) data.save(tempfile) - def test_segfault(self): PillowQtTestCase.setUp(self) @@ -59,15 +56,5 @@ if ImageQt.qt_is_installed: lbl.setPixmap(pixmap1.copy()) - - -def main(): - app = QtGui.QApplication(sys.argv) - ex = Example() - sys.exit(app.exec_()) - - - - if __name__ == '__main__': unittest.main() From b6e143bd1fa66f54c479eb4e7c25f81f1bd4caa9 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sun, 19 Feb 2017 12:04:18 +0200 Subject: [PATCH 2/2] flake8 --- Tests/test_image_toqimage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/test_image_toqimage.py b/Tests/test_image_toqimage.py index a4a03409a..39e68ebbb 100644 --- a/Tests/test_image_toqimage.py +++ b/Tests/test_image_toqimage.py @@ -5,7 +5,7 @@ from PIL import ImageQt if ImageQt.qt_is_installed: - from PIL.ImageQt import QImage, QPixmap + from PIL.ImageQt import QImage try: from PyQt5 import QtGui @@ -35,6 +35,8 @@ class TestToQImage(PillowQtTestCase, PillowTestCase): app = QtGui.QApplication([]) ex = Example() + assert(app) # Silence warning + assert(ex) # Silence warning if ImageQt.qt_is_installed: @@ -43,7 +45,7 @@ if ImageQt.qt_is_installed: def __init__(self): super(Example, self).__init__() - img = hopper().resize((1000,1000)) + img = hopper().resize((1000, 1000)) qimage = ImageQt.ImageQt(img)