From: <nr...@us...> - 2008-08-07 17:11:21
|
Revision: 5102 http://jython.svn.sourceforge.net/jython/?rev=5102&view=rev Author: nriley Date: 2008-08-07 17:11:16 +0000 (Thu, 07 Aug 2008) Log Message: ----------- Don't attempt to test AWT if we have no display. Modified Paths: -------------- branches/asm/Lib/test/test_java_integration.py Modified: branches/asm/Lib/test/test_java_integration.py =================================================================== --- branches/asm/Lib/test/test_java_integration.py 2008-08-07 11:56:31 UTC (rev 5101) +++ branches/asm/Lib/test/test_java_integration.py 2008-08-07 17:11:16 UTC (rev 5102) @@ -4,9 +4,11 @@ import re from test import test_support -from java.awt import Dimension, Component, Rectangle, Button, Color +from java.awt import (Dimension, Component, Rectangle, Button, Color, + HeadlessException) from java.util import Vector, Hashtable -from java.io import FileOutputStream, FileWriter, OutputStreamWriter, UnsupportedEncodingException +from java.io import (FileOutputStream, FileWriter, OutputStreamWriter, + UnsupportedEncodingException) from java.lang import Runnable, Thread, ThreadGroup, System, Runtime, Math, Byte from javax.swing.tree import TreePath from java.math import BigDecimal @@ -325,8 +327,11 @@ class ButtonTest(unittest.TestCase): def test_setLabel(self): - b = Button() try: + b = Button() + except HeadlessException: + return # can't raise TestSkipped + try: b.setLabel = 4 except TypeError, e: self.failUnless("can't assign to this attribute in java instance: setLabel" in str(e)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |