From 7c9dca49b4166e01d1c64253d16bf3050823311d Mon Sep 17 00:00:00 2001 From: Samuel John Date: Wed, 5 Jun 2013 10:26:57 +0200 Subject: PyQt: brew test automatically quits after 2.5 sec. Blocking tests are bad for brew-test-bot. --- Library/Formula/pyqt.rb | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 20898543c..67fea3cac 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -35,31 +35,23 @@ class Pyqt < Formula test do python do - # Todo: For brew-test-bot we need to add a timer that quits after 1 s or so. - # Reference: http://zetcode.com/tutorials/pyqt4/firstprograms/ (testpath/'test.py').write <<-EOS.undent import sys from PyQt4 import QtGui, QtCore - class QuitButton(QtGui.QWidget): + class Test(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) - - self.setGeometry(300, 300, 250, 150) - self.setWindowTitle('Quit button') - - quit = QtGui.QPushButton('Close', self) - quit.setGeometry(10, 10, 60, 35) - - self.connect(quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) - - app = QtGui.QApplication(sys.argv) - qb = QuitButton() - qb.show() - app.exec_() - sys.exit(0) + self.setGeometry(300, 300, 400, 150) + self.setWindowTitle('Homebrew') + QtGui.QLabel("Python #{python.version} working with PyQt4. Quitting now...", self).move(50, 50) + QtCore.QTimer.singleShot(2500, QtGui.qApp, QtCore.SLOT('quit()')) + + app = QtGui.QApplication([]) + window = Test() + window.show() + sys.exit(app.exec_()) EOS system python, "test.py" -- cgit v1.2.3