Masinde70
3/23/2018 - 4:45 AM

testing

Assertion The verification phase is done through the use of assertions. An assertion is a function which you can use to verify equality between objects, as well as other conditions. When conditon is not, the assertion will raise an exception that will make your test fail.You can find a list of assertions in the unittest module documentation, and their corresponding Pythonic version in the nose third-party library, which provides a few advantages over the sheer unittest module, starting from an improved test discovery strategy (which is the way a test runner detects and discovers the tests in your application). The act of replacing a real object or function (or in general, any piece of data structure) with a mock, is called patching. The mock library provides the patch tool, which can act as a function or class decorator, and even as a context manager

def filter_inits(v):
  return[num for num in v if is_postive(num)]
  
def is_postive(n):
  return n > 0