Skip to content

Commit a5cd051

Browse files
author
Daniele Esposti
committed
Fixed unit test under Python 2.5
1 parent 975ae01 commit a5cd051

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/patterns/facade.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,5 @@ def testGetInstance(self):
191191
class MyFacade(Facade):
192192
pass
193193

194-
self.assertIsInstance(MyFacade.getInstance("myFacade"), MyFacade)
194+
# Use 'assertTrue' for Python 2.5 compatibility
195+
self.assertTrue(isinstance(MyFacade.getInstance("myFacade"), MyFacade))

tests/patterns/observer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ def testSendNotificationNoBodyAndType(self):
110110
"""NotifierTest: send notification without body and type"""
111111
try:
112112
self.notifier.sendNotification("TestNotification")
113-
except Exception as e:
113+
except Exception, e: # Old-style 'except' for Python 2.5 compatibility
114114
self.fail(e)
115115

116116
def testSendNotificationNoType(self):
117117
"""NotifierTest: send notification without type"""
118118
try:
119119
self.notifier.sendNotification("TestNotification", 1)
120-
except Exception as e:
120+
except Exception, e: # Old-style 'except' for Python 2.5 compatibility
121121
self.fail(e)

0 commit comments

Comments
 (0)