Changeset 79:d49b898f3abd

Show
Ignore:
Timestamp:
04/12/07 17:50:27 (20 months ago)
Author:
Tarek Ziad?? <tarek@…>
Message:

added example

Location:
RuPy
Files:
3 added
1 modified

Legend:

Unmodified
Added
Removed
  • RuPy/slides.txt

    r78 r79  
    282282    import unittest 
    283283 
     284    # let's say, division function is in division module 
     285    from division import division 
     286 
    284287    class DivisionTestCase(unittest.TestCase): 
    285288 
     
    292295    def test_suite(): 
    293296        suite = unittest.TestSuite() 
    294         suite.addTest(DivisionTestCase) 
     297        suite.addTests(unittest.makeSuite(DivisionTestCase)) 
    295298        return suite 
    296299 
     
    298301        unittest.main(defaultTest='test_suite') 
    299302 
     303How to write tests in Python 
     304============================ 
     305 
     306Running the tests with the Python interpreter:: 
     307 
     308 
     309    dabox:~ tarek$ python test_division.py 
     310    .. 
     311    ------------------------------------------------------------------ 
     312    Ran 2 tests in 0.000s 
     313 
     314    OK 
    300315 
    301316How to write tests in Python