Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.38 KB

okok.md

File metadata and controls

49 lines (40 loc) · 1.38 KB


At a glance... | Syllabus | Models | Code | Lecturer

Examples of Unit tests in Python


   1:   import time
   2:   from ok import *
   3:   
   4:   print time.strftime("%H:%M:%S\n")
   5:   
   6:   @ok
   7:   def _ok():
   8:     assert 9 == 3
   9:     
  10:   @ok
  11:   def _ok1():
  12:     assert 1==1
  13:   
  14:   @ok
  15:   def _ok2():
  16:     assert 2==1
  17:   
  18:   @ok
  19:   def _ok3():
  20:     assert 3==3 
  21:   
  22:   @ok
  23:   def _ok4():
  24:     assert unittest.tries==4
  25:     assert unittest.fails==1
  26:     print unittest.score() 

Copyright © 2015 Tim Menzies. This is free and unencumbered software released into the public domain.
For more details, see the license.