_MOD = 'testUnit.py'
import unittest
class SimpleCase(unittest.TestCase):
def setUp(self):
pass
def test(self):
"""checking potential assertion errors"""
assert 1==1
def tearDown(self):
pass
class ExceptionCheckCase(unittest.TestCase):
def setUp(self):
pass
def test(self):
"""testing an exception catch"""
try:
1/0
except ZeroDivisionError:
pass
else:
self.fail("expected a ZeroDivisionError")
def tearDown(self):
pass
# there are not needed w/ main below
#
# testSuite = unittest.TestSuite()
# testSuite.addTest(SimpleCase())
#
#
#
# runner = unittest.TextTestRunner()
# runner.run(testSuite)
if __name__ == "__main__":
unittest.main()
|