test

module fastcore.test in fastcore

Classes

builtins.object
    ExceptionExpected

ExceptionExpected

class ExceptionExpected(builtins.object)
 |  ExceptionExpected(ex=<class 'Exception'>, regex='')
 |  
 |  Context manager that tests if an exception is raised
 |  
 |  Methods defined here:
 |  
 |  

ExceptionExpected.__enter__

 |  
 |  __enter__(self)
 |  
 |  

ExceptionExpected.__exit__

 |  
 |  __exit__(self, type, value, traceback)
 |  
 |  

ExceptionExpected.__init__

 |  
 |  __init__(self, ex=<class 'Exception'>, regex='')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)

Functions

is_close

is_close(a, b, eps=1e-05)
    Is `a` within `eps` of `b`

nequals

nequals(a, b)
    Compares `a` and `b` for `not equals`

test

test(a, b, cmp, cname=None)
    `assert` that `cmp(a,b)`; display inputs and `cname or cmp.__name__` if it fails

test_close

test_close(a, b, eps=1e-05)
    `test` that `a` is within `eps` of `b`

test_eq

test_eq(a, b)
    `test` that `a==b`

test_eq_type

test_eq_type(a, b)
    `test` that `a==b` and are same type

test_fail

test_fail(f, msg='', contains='', args=None, kwargs=None)
    # %% ../nbs/00_test.ipynb 6

test_fig_exists

test_fig_exists(ax)
    Test there is a figure displayed in `ax`

test_is

test_is(a, b)
    `test` that `a is b`

test_ne

test_ne(a, b)
    `test` that `a!=b`

test_shuffled

test_shuffled(a, b)
    `test` that `a` and `b` are shuffled versions of the same sequence of items

test_stdout

test_stdout(f, exp, regex=False)
    Test that `f` prints `exp` to stdout, optionally checking as `regex`

test_warns

test_warns(f, show=False)
    # %% ../nbs/00_test.ipynb 40