aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorSamuel John2013-08-08 12:18:06 +0200
committerSamuel John2013-08-08 12:22:50 +0200
commite046fe1f0331b462826947aa2fc1e7725dba57d5 (patch)
treed7dc19d8ed89d50c4f80d6ba3c3642b13c40bf4f /Library/Formula
parentadec638d86197eeca7dc46686d9c8de39bd3022f (diff)
downloadhomebrew-e046fe1f0331b462826947aa2fc1e7725dba57d5.tar.bz2
pyqt5: Improve test
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/pyqt5.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/Library/Formula/pyqt5.rb b/Library/Formula/pyqt5.rb
index e1f156210..51ae3b93e 100644
--- a/Library/Formula/pyqt5.rb
+++ b/Library/Formula/pyqt5.rb
@@ -46,27 +46,27 @@ class Pyqt5 < Formula
end
test do
- python do
- (testpath/'test.py').write <<-EOS.undent
- import sys
- from PyQt5 import QtGui, QtCore, QtWidgets
-
- class Test(QtWidgets.QWidget):
- def __init__(self, parent=None):
- QtWidgets.QWidget.__init__(self, parent)
- self.setGeometry(300, 300, 400, 150)
- self.setWindowTitle('Homebrew')
- QtWidgets.QLabel("Python #{python.version} working with PyQt5. Quitting now...", self).move(50, 50)
- QtCore.QTimer.singleShot(2500, QtWidgets.qApp.quit)
+ # To test Python 2.x, you have to `brew test pyqt --with-python`
+ (testpath/'test.py').write <<-EOS.undent
+ import sys
+ from PyQt5 import QtGui, QtCore, QtWidgets
- app = QtWidgets.QApplication([])
- window = Test()
- window.show()
- sys.exit(app.exec_())
- EOS
+ class Test(QtWidgets.QWidget):
+ def __init__(self, parent=None):
+ QtWidgets.QWidget.__init__(self, parent)
+ self.setGeometry(300, 300, 400, 150)
+ self.setWindowTitle('Homebrew')
+ QtWidgets.QLabel("Python " + "{0}.{1}.{2}".format(*sys.version_info[0:3]) +
+ " working with PyQt5. Quitting now...", self).move(50, 50)
+ QtCore.QTimer.singleShot(1500, QtWidgets.qApp.quit)
- system "python#{python.if3then3}", "test.py"
- rm testpath/'test.py'
+ app = QtWidgets.QApplication([])
+ window = Test()
+ window.show()
+ sys.exit(app.exec_())
+ EOS
+ python do
+ system python, "test.py"
end
end
end